Closed Bug 730636 Opened 14 years ago Closed 14 years ago

Implement resetting

Categories

(Firefox for Android Graveyard :: Android Sync, defect, P1)

ARM
Android
defect

Tracking

(blocking-fennec1.0 beta+)

VERIFIED FIXED
mozilla14
Tracking Status
blocking-fennec1.0 --- beta+

People

(Reporter: rnewman, Assigned: rnewman)

References

Details

(Whiteboard: [sync][qa+])

Realized we didn't have a bug for this. "Resetting" describes a category of operations ranging from clearing a set of metadata fields (e.g., sync times) through to a total device wipe. These are necessary for: * "First sync" behaviors: replace the contents of this device with the server (Bug 709361) * "Reset sync": "do a first sync again, even if I'm already set up" (no bug yet) * Command processing: handling the requests of another device that's asked us to wipe ourselves. (Bug 715792)
Blocks: 722724
blocking-fennec1.0: --- → ?
blocking-fennec1.0: ? → beta+
What's the simplest thing we can do that still provides the experience we want here? Should we provide only one operation like total wipe and let a new sync restore and that's it? Trying to prevent scope creep.
(In reply to Damon Sicore (:damons) from comment #2) > What's the simplest thing we can do that still provides the experience we > want here? Should we provide only one operation like total wipe and let a > new sync restore and that's it? > > Trying to prevent scope creep. Understood and appreciated. All of the aspects of this bug are applications of the same two chunks of bedrock: wiping timestamps and wiping data. The latter requires the former. This bug is to build those two things. The operations built on top of these -- handling being told "wipe just this engine", "wipe everything", "set timestamps to 0 and merge" -- are pretty tiny by comparison, so I'm afraid there isn't really a great deal of fat to prune here. The big chunk of fat is the layer above: e.g., kicking off a Reset Sync operation *from* the phone, requiring UI. That's Bug 709361 (P2) and beyond, and thus already out of scope for this. Hope that helps clarify the scope.
Assignee: nobody → ally
Whiteboard: [sync]
Assignee: ally → rnewman
work continues on github
Update for the day: resetting and wiping functionality implemented for ServerSyncStage and SyncClientsEngineStage. Unit tests for low-level functionality done. Integration tests for stage-level operations done. Next up: command-driven tests, then a manual test plan. See https://github.com/mozilla-services/android-sync/pull/168 .
Status: NEW → ASSIGNED
No longer blocks: 722724
QA steps: * Pair two devices. Sync mobile, then sync desktop. * In a privileged console on desktop: Components.utils.import("resource://services-sync/engines/clients.js"); Clients.sendCommand("wipeEngine", ["bookmarks"]); * Sync desktop then mobile. * Ensure that the mobile adb log shows something like: I/GlobalSession( 5839): Running next stage syncClientsEngine (org.mozilla.gecko.sync.stage.SyncClientsEngineStage@412aa470)... I/SyncClientsEngineStage( 5839): Local client GUID exists on server and was downloaded I/GlobalSession( 5839): Wiping org.mozilla.gecko.sync.stage.AndroidBrowserBookmarksServerSyncStage@411c4850 I/SynczrConfiguration( 5839): Initialized SynchronizerConfiguration. syncID: null, remoteBundle: {"timestamp":1335065727320}, localBundle: {"timestamp":1335065727480} D/RepositorySessionBundle( 5839): Setting timestamp on RepositorySessionBundle to 0 D/RepositorySessionBundle( 5839): Setting timestamp on RepositorySessionBundle to 0 I/ServerSyncStage( 5839): Reset timestamps for org.mozilla.gecko.sync.stage.AndroidBrowserBookmarksServerSyncStage@411c4850 D/BrowserRepoSession( 5839): Check and build special GUIDs. D/BrowserRepoSession( 5839): Got GUIDs for folders. D/BrowserRepoSession( 5839): Preparing folder ID mappings. D/BrowserRepoSession( 5839): Tracking places root as ID 0. D/BrowserRepoSession( 5839): GUID mobile maps to 1 ... D/BrowserRepoSession( 5839): Done with initial setup of bookmarks session. I/BrowserRepoSession( 5839): BEGIN: checking database. I/BrowserRepoSession( 5839): END: checking database. I/BookmarksDataAccessor( 5839): wiping (except for special guids): content://org.mozilla.fennec_rnewman.db.browser/bookmarks?sync=true&show_deleted=true I/ServerSyncStage( 5839): Wiping stage complete. I/RepositorySession( 5839): Shutting down work queues. I/SyncAdapter( 5839): Stage completed: syncClientsEngine You'll subsequently see all of the desktop bookmarks being re-downloaded, with no non-special-folder bookmark finding a match: D/BrowserRepoSession( 5839): Finding existing record for incoming record with GUID H7ZwOAOuM3pc D/BrowserRepoSession( 5839): Searching with record string bmobile/http://slashdot.org/:Slashdot: News for nerds, stuff that matters D/BrowserRepoSession( 5839): findExistingRecord failed to find one for H7ZwOAOuM3pc D/BrowserRepoSession( 5839): Inserting bookmark H7ZwOAOuM3pc with parent 1 (mobile, , 0) D/BrowserRepoSession( 5839): Inserted as 55 * Now open Sync Preferences on desktop. Choose "Reset Sync", "Replace other devices...". Verify that you see the mobile device in the "these devices will be overwritten" window. You'll see the following in the mobile log on next sync: I/GlobalSession( 5839): Running next stage syncClientsEngine (org.mozilla.gecko.sync.stage.SyncClientsEngineStage@41187270)... I/SyncClientsEngineStage( 5839): Local client GUID exists on server and was downloaded I/GlobalSession( 5839): Wiping org.mozilla.gecko.sync.stage.AndroidBrowserBookmarksServerSyncStage@4116b1d8 ... I/BookmarksDataAccessor( 5839): wiping (except for special guids): content://org.mozilla.fennec_rnewman.db.browser/bookmarks?sync=true&show_deleted=true I/ServerSyncStage( 5839): Wiping stage complete. I/GlobalSession( 5839): Wiping org.mozilla.gecko.sync.stage.FormHistoryServerSyncStage@4113c760 ... I/ServerSyncStage( 5839): Reset timestamps for org.mozilla.gecko.sync.stage.FormHistoryServerSyncStage@4113c760 D/FormHistoryProvider( 5839): No profile provided, using default ... I/ServerSyncStage( 5839): Wiping stage complete. I/GlobalSession( 5839): Wiping org.mozilla.gecko.sync.stage.AndroidBrowserHistoryServerSyncStage@411620c8 ... I/ServerSyncStage( 5839): Wiping stage complete. I/GlobalSession( 5839): Wiping org.mozilla.gecko.sync.stage.FennecTabsServerSyncStage@4119e7d0 ... I/ServerSyncStage( 5839): Wiping stage complete. I/SyncAdapter( 5839): Stage completed: syncClientsEngine The particular stages that are wiped will depend on the boxes that are checked on desktop.
Note that after these wipe syncs complete, Fennec will show *exactly* the bookmarks and history that you see on desktop. If you've added or deleted bookmarks or history in Fennec between syncs, they will be lost if you have selected Reset Sync on desktop. That is: * Sync desktop and mobile. * Add a bookmark on mobile. * Choose "Reset Sync" on desktop. Sync desktop then mobile. * Wait for mobile sync to complete (spinner to stop turning). * Verify that the site you just bookmarked is no longer present in Bookmarks.
Note that between I/GlobalSession( 5839): Running next stage syncClientsEngine and I/SyncAdapter( 5839): Stage completed: syncClientsEngine you should see no exceptions (ignoring the usual Android built-in apps that spew log crap, of course).
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Flags: in-litmus?
Whiteboard: [sync] → [sync][qa+]
Flags: in-litmus? → in-litmus?(fennec)
reset from desktop working fine.
Status: RESOLVED → VERIFIED
Basic sync account reset test created for Firefox Mobile: https://moztrap.mozilla.org/manage/cases/_detail/6303/ The test case was added in the Full Function suite.
Flags: in-litmus?(fennec) → in-moztrap+
Product: Mozilla Services → Android Background Services
Product: Android Background Services → Firefox for Android
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.