Closed Bug 435341 Opened 16 years ago Closed 16 years ago

Weave should sync on browser shutdown

Categories

(Cloud Services :: General, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: avarma, Assigned: myk)

References

()

Details

Attachments

(1 file, 3 obsolete files)

Weave should sync on browser shutdown.  Ideally, it should be able to abort a currently-executing sync if the user really wants to quit, but since Weave can't currently be cancelled, we should display a modal progress dialog telling them to wait.
Blocks: 433900
Window with progress-bar can be shown. 
With big button "stop upload and exit immediately".
Maybe, for fasten closing, there a reason to perform upload changes only instead full synchronization, if it is possible at all.
We don't currently have the ability to abort a sync operation, and are not likely to get it for the 0.2 release.  Thus, for 0.2, simply requesting that the user wait is sufficient.

However, I would certainly find the time to review a patch to add abort support if it were to appear on bugzilla ;-)
What about possibility of "upload-only" synchronization?
The upload step comes very late in the weave sync algorithm (it's one of the last steps, in fact).  So "upload only" is not realistically useful/feasible without a major architecture shift.
Priority: -- → P2
Target Milestone: -- → 0.2
Now sync need a lot of time. More than a minute. 
Some locks from another pc can disable sync on close.

Maybe, sync process can be modifyed as this:
1. pc don't download any data on sync; it only uploads change commands from last sync. No locks performed on server, unique names generated.
2. on sync pc checks for "upload-only" data, and integrate it into main base, than upload this files from server after finish of own upload?
(In reply to comment #5)
> Now sync need a lot of time. More than a minute. 
> Some locks from another pc can disable sync on close.

Yes.  For the purposes of this bug (for 0.2), we should decide whether we will wait in that case, or simply close.
 
> Maybe, sync process can be modifyed as this:
> 1. pc don't download any data on sync; it only uploads change commands from
> last sync. No locks performed on server, unique names generated.
> 2. on sync pc checks for "upload-only" data, and integrate it into main base,
> than upload this files from server after finish of own upload?

The problem with this method is that it multiplies the upload/download requirements of subsequent sync operations.  That is, if you only upload local changes to a unique file on the server, the next sync will need to 1) download that unique file, 2) compute the "real" changes for the server (with server changes merged and conflicts resolved), and 3) re-upload the same data.  So in order to gain 1 fast sync up, you are causing 2 additional transfers of the same data.

However, that said, there are potential optimizations which might make a similar technique feasible.  But regardless, that is a topic for another bug, which should be targeted (probably) for 0.3.
i think we should do the minimum here for now, that is:  1) close the browser window and allow the user to continue working their desktop, 2) open a small dialog that indicates that data is being transferred to Weave, and 3) close that dialog when the transfer is complete or a timeout or error occurs.

while is is far from ideal, it does let us keep people in sync and also allows to fully debug the experience and get wider feedback
Assignee: nobody → myk
Agreed.  We could even do without closing the browser window IMO, if that turns out to be difficult.
Looking at this...
Status: NEW → ASSIGNED
Attached patch work in progress patch (obsolete) — Splinter Review
Here's a work in progress that syncs on shutdown but doesn't notify the user about it or close windows while it proceeds.
Attached patch work in progress patch (obsolete) — Splinter Review
Here's another patch that notifies the user but has the problem that the user gets prompted twice about what to do with open tabs.
Attached patch work in progress patch (obsolete) — Splinter Review
Here's another work in progress.  It's much simpler, and I wish it worked, but status.xul gets opened asynchronously, and by the time it's ready to cancel the application quit, the application has already quit.
Here's a patch that implements this functionality.  It waits until windows have been closed and the application is about to quit (but components and modules are still available), then it opens a modal window that prevents the application from quitting and runs a sync.

Note: there is no "abort" button, because Weave syncs don't currently support abort, but the user can abort the sync (leaving the server in an undefined state, including the presence of a server lock that prevents future syncs until broken) by closing the modal window.

Sync happens on quit by default, but you can disable it by setting the extensions.weave.syncOnQuit.enabled hidden preference to false.

I reuse existing icons to indicate status in the window, but ideally we'd have larger versions of them (and an icon to indicate "success"; currently I use the built-in "information" icon for that).

After sync has finished, the window stays up for two seconds to give the user time to read the success/error message if they happen to be looking at the window, after which it closes, and the application quits.  It'd perhaps be better to trigger a growl notification or the like at that point, but that's for the future.
Attachment #325893 - Attachment is obsolete: true
Attachment #326065 - Attachment is obsolete: true
Attachment #326067 - Attachment is obsolete: true
changeset:   643:95605f7c8c6b
date:        Mon Jun 23 16:10:31 2008 -0700
summary:     bug 435341: sync automatically when Firefox quits
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Component: Weave → General
Product: Mozilla Labs → Weave
QA Contact: weave → general
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: