Skip to content
This repository has been archived by the owner on Nov 14, 2018. It is now read-only.

Fix android sync #1163

Closed

Conversation

thomasysliu
Copy link

The android client will fail to get

JSON response like {"modified":1371310063.91,"success":["7USxn4YvYwZI","dXu95gUYHkMb"],"failed":[]}

The main problem is "failed":[] instead of "failed":{}

But it will also fail when change all [] to {}

The solution is unset the unused variable to meet http://dxr.mozilla.org/mozilla-central/source/mobile/android/base/sync/repositories/Server11RepositorySession.java#l480

    JSONArray          success = body.getArray("success");
    if ((success != null) &&

    ExtendedJSONObject failed  = body.getObject("failed");
    if ((failed != null) &&

@ghost
Copy link

ghost commented Jun 15, 2013

Can one of the admins verify this patch?

@thomasysliu
Copy link
Author

According to http://docs.services.mozilla.com/storage/apis-1.1.html#id2

The failed field needs to be object format.

POST https://server/pathname/version/username/storage/collection

Takes an array of WBOs in the request body and iterates over them, effectively doing a series of atomic PUTs with the same timestamp.

Returns a hash of successful and unsuccessful saves, including guidance as to possible errors:

{"modified": 1233702554.25,
 "success": ["{GXS58IDC}12", "{GXS58IDC}13", "{GXS58IDC}15",
             "{GXS58IDC}16", "{GXS58IDC}18", "{GXS58IDC}19"],
 "failed": {"{GXS58IDC}11": ["invalid parentid"],
            "{GXS58IDC}14": ["invalid parentid"],
            "{GXS58IDC}17": ["invalid parentid"],
            "{GXS58IDC}20": ["invalid parentid"]}}

@jancborchardt
Copy link
Contributor

Who maintains this app and can review this pull request? Calling @DeepDiver1975 @eMerzh @Kondou-ger because you worked on the relevant files before.

@DeepDiver1975
Copy link
Contributor

@jaskoola is the maintainer

@DeepDiver1975
Copy link
Contributor

@eMerzh @jakobsack @jaskoola what about merging the mozilla_sync and the bookmarks app? I see no reason to keep them separated

@thomasysliu
Copy link
Author

@DeepDiver1975 the reason why mozilla_sync and bookmarks app are separated is because http://docs.services.mozilla.com/storage/apis-1.1.html#payload the payload is encrypted and conventionally do not store encryption key at server side.

@DeepDiver1975
Copy link
Contributor

the payload is encrypted and conventionally do not store encryption key at server side.

What a pity ...

@DeepDiver1975
Copy link
Contributor

@jakobsack you have been mentoring @jaskoola - right? You know if he is still actively developing this app? THX

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants