Closed Bug 733886 Opened 8 years ago Closed 8 years ago

Tabs engine goes all honey badger about data types

Categories

(Firefox :: Sync, defect)

defect
Not set

Tracking

()

VERIFIED FIXED
mozilla14

People

(Reporter: rnewman, Assigned: rnewman)

References

Details

(Whiteboard: [verified in services][qa!])

Attachments

(1 file)

Tabs engine don't care what the docs say. Tabs engine don't care what's stored in the tab. Tabs engine do what he wants.

  {title:"Twitter", urlHistory:["http://twitter.com/"], icon:"...", lastUsed:0}, 

  {title:"Download VLC media player from SourceForge.net", urlHistory:[...], icon:"...", lastUsed:"1306374564"}, 

It's a bird! It's a string! It's an integer!

The culprit is:

           paul:           lastUsed: tab.extData && tab.extData.weaveLastUsed || 0

This should be fixed to always produce integers, and be safe regardless of what nonsense it processes from the server.

This makes Android Sync very unhappy. Stab stab stab stab.
With tests!
Assignee: nobody → rnewman
Status: NEW → ASSIGNED
Attachment #605587 - Flags: review?(gps)
Comment on attachment 605587 [details] [diff] [review]
Proposed patch. v1

Review of attachment 605587 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good to me.
Attachment #605587 - Flags: review?(gps) → review+
Nit: Please use a real commit message.
https://hg.mozilla.org/services/services-central/rev/ecb4a985463d

The only QA for this will involve syncing tabs and ensuring that

Components.utils.import("resource://services-sync/main.js");
Components.utils.import("resource://services-sync/record.js");
let te = Weave.Engines.get("tabs");
let recordType = te._recordObj;
let coll = new Collection(Weave.Service.storageURL + "tabs", recordType);
coll.full = true;
coll.recordHandler = function(item) {
  item.collection = "tabs";
  item.decrypt();
  for each (let tab in item.cleartext.tabs) {
    console.log(JSON.stringify(tab.lastUsed));
  }
};
coll.get();


doesn't print

[16:55:59.227] 0 @ Web Console:7
[16:55:59.412] "1331682375" @ Web Console:7
[16:55:59.417] "1331682002" @ Web Console:7

but instead prints numbers without quotes in all cases.

Also verify that tab sync works between desktop-desktop and desktop->mobile.

Thanks!
Whiteboard: [fixed in services][qa+]
verified with s-c builds of 20120327
Whiteboard: [fixed in services][qa+] → [verified in services][qa+]
https://hg.mozilla.org/mozilla-central/rev/ecb4a985463d
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla14
Status: RESOLVED → VERIFIED
Whiteboard: [verified in services][qa+] → [verified in services][qa!]
Duplicate of this bug: 615920
Component: Firefox Sync: Backend → Sync
Product: Cloud Services → Firefox
You need to log in before you can comment on or make changes to this bug.