Closed Bug 1205220 Opened 5 years ago Closed 5 years ago

SyncManager - Sync app glue

Categories

(Firefox OS Graveyard :: Sync, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
FxOS-S8 (02Oct)

People

(Reporter: ferjm, Assigned: ferjm)

References

Details

Attachments

(1 file)

We need to create the glue between the SyncManager and the Sync app.

SyncManager uses a simple IAC based API to request a Sync when the requestSync timer expires or the user requests a sync on demand. We need to implement this API on the Sync app.
Assignee: nobody → ferjmoreno
Target Milestone: --- → FxOS-S7 (18Sep)
Blocks: fxos-sync
Related to this, in bug 1204432 I drafted an `App.handleRequest` function here:

https://github.com/michielbdejong/gaia/blob/1204432-sync-app-lazyloader/apps/sync/js/app.js

It does:
* the lazy loading of main scripts
* the lazy loading of the necessary DataAdapters
* the call to the SyncEngine constructor
* the call to SyncEngine#syncNow

Maybe this glue code can make the call to `App.handleRequest(request)`, where `request` could contain:
* assertion {String}
* keys {Object with kA: String, kB: String}
* collections {Array of strings}
* URL (of the Syncto server) {String}
* email (of the current user) {String}
Actually, we don't need email, we can use xClientState as a unique identifier of the current user. So only assertion, keys, collections, and URL.
Target Milestone: FxOS-S7 (18Sep) → FxOS-S8 (02Oct)
No longer blocks: 1204432
Depends on: 1204432
Depends on: 1210725
Attachment #8668583 - Flags: review?(mbdejong)
Comment on attachment 8668583 [details] [review]
[gaia] ferjm:bug1205220.syncglue > mozilla-b2g:master

Works for me if I:
* build Mulet with the Gecko fix from bug 1210725
* cat build/config/custom-settings.json 
{
  "sync.server.url": "http://localhost:8000/v1/"
}
* Untick 'passwords' in the Settings app before clicking 'Sync now' (opened bug 1210804 about that)

Awesome! :)
Attachment #8668583 - Flags: review?(mbdejong) → review+
PS: I did find some funny states btw, for instance, I can't disable sync while a sync request is in progress. We can do more testing and bug filing&fixing about such things next Sprint.
Thanks!

(In reply to Michiel de Jong [:michielbdejong] from comment #4)
> Comment on attachment 8668583 [details] [review]
> [gaia] ferjm:bug1205220.syncglue > mozilla-b2g:master
> 
> Works for me if I:
> * build Mulet with the Gecko fix from bug 1210725
> * cat build/config/custom-settings.json 
> {
>   "sync.server.url": "http://localhost:8000/v1/"
> }
> * Untick 'passwords' in the Settings app before clicking 'Sync now' (opened
> bug 1210804 about that)
> 

That's https://bugzilla.mozilla.org/show_bug.cgi?id=1210473
(In reply to Michiel de Jong [:michielbdejong] from comment #5)
> PS: I did find some funny states btw, for instance, I can't disable sync
> while a sync request is in progress. We can do more testing and bug
> filing&fixing about such things next Sprint.

That's https://bugzilla.mozilla.org/show_bug.cgi?id=1205239 :)
https://github.com/mozilla-b2g/gaia/commit/9d2df35cb1addc0bdb81c1c886240a6817a74781
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.