Open Bug 1352026 Opened 7 years ago Updated 2 years ago

WebExtension data is incorrectly synced

Categories

(WebExtensions :: General, defect, P5)

defect

Tracking

(Not tracked)

REOPENED

People

(Reporter: vtamas, Unassigned)

Details

(Whiteboard: triaged)

Attachments

(3 files)

[Affected versions]:
Firefox 55.0a1 (2017-03-29)
Firefox 54.0a2 (2017-03-29)
Firefox 53.0b7 (20170327081421)


[Affected platforms]:
Windows 10 64-bit
Ubuntu 16.04 32-bit

[Steps to reproduce]:
1.Launch Firefox with 2 clean profiles.
2.Go to about:preferences#sync and create a new fxa account.
3.Login on both profiles using the new created account. 
4.Install the attached webextenion on both profiles.
5.On one of the profiles, navigate to about:addons and set some data for the installed webextension.
6.Force a sync.
7.Go to the second profile, force a sync and check the webextension values.

[Expected Results]:
The entire webextension data is properly synced between profiles.

[Actual Results]:
- The data is not entirely/correctly synced.
- There were no errors thrown in Browser Console 

[Additional notes]:
This issue might not reproduce at the first attempt, but I noticed that all the values are reset after enabling the colors that was initially disabled. I suspect that those colors which are reset to default are not synced between profiles (see the second sync process from the attached video)
Attached image Animation.gif
I am attaching the screencast.
looking into a bit more
Flags: needinfo?(amckay)
Priority: -- → P5
Whiteboard: triaged
This is kind of mind-boggling. When trying to figure out what's happening, I used these hacky commands in the browser console to see a little bit about what the extension stores:

Cu.import("resource://gre/modules/ExtensionStorageSync.jsm");
let later;
extensionStorageSync.get({id: "categorytabs@mozilla.org"}, null, {callOnClose: f => (later = f)}).then(res => console.log(res));     // or console.log(JSON.stringify(res)) if you don't like exploring interactively
later.close();  // cleanup

I see that the extension has two "items", one for enabledColors (array of "checked" colors by their hard-coded names -- red, yellow, green, etc.) and customNames (object of hard-coded name to user label: {"red": "11111111"} etc.). But the behavior I saw in your screencast doesn't correspond exactly to one of those "items" being missing -- all the correct colors are checked, and "some" of the labels are present.

I think partly this extension has a bug that isn't related to chrome.storage.sync. Check this out:

1. Load the category-keep extension.
2. Change the label for "Orange" to some interesting value such as "11111111".
3. Uncheck "Green".

Expected result:

Green would be unchecked, and Orange would retain the label "11111111".

Actual result:

Green is unchecked but Orange's label gets reset. I believe this is what you show in your screencast when you uncheck one element and other labels get reset.

I tried looking at the extension's code but it's all minified JavaScript and I don't hate myself enough for that. Is there a preferred form for modification somewhere that I could look at? Maybe :andym knows?

In the meantime, Vasilica, any chance you could run the code above to show the extension's data on both machines just before syncing on the first computer and just after syncing on the second computer? If I were a betting man, I would place a small wager that the data is coming through OK but the extension isn't handling it correctly. (It may be that it's using onChanged notifications in a way differently from how I implemented them, or it may just be random other bugs.)
Yeah, I agree with ethan that I think we need a simpler use case than this add-on, because we can't determine if this occurs because of the add-on or something in our code. Presumably this is an extension from the Chrome store?
Flags: needinfo?(amckay)
Attached file sync-error.txt
Considering that “Category tabs for google keeptm” add-on is broken I tested a second time using another webextension ( https://addons-dev.allizom.org/en-US/firefox/addon/instant-multi-search/ ) and seems that the webextension data is correctly synced between profiles. But a sync error is encountered at the first sync process even the values are properly synced.
I think this is the same as bug 1351678 and will be resolved by it.
Per policy at https://wiki.mozilla.org/Bug_Triage/Projects/Bug_Handling/Bug_Husbandry#Inactive_Bugs. If this bug is not an enhancement request or a bug not present in a supported release of Firefox, then it may be reopened.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → INACTIVE
Status: RESOLVED → REOPENED
Resolution: INACTIVE → ---
Product: Toolkit → WebExtensions
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: