Update version of Kinto.js client to 5.0.0

RESOLVED FIXED in Firefox 52

Status

RESOLVED FIXED
2 years ago
3 months ago

People

(Reporter: glasserc, Assigned: glasserc)

Tracking

unspecified
mozilla52

Firefox Tracking Flags

(firefox52 fixed)

Details

(Whiteboard: triaged)

Attachments

(2 attachments)

(Assignee)

Description

2 years ago
This version of Kinto.js has a `resetSyncStorage` function in FirefoxStorage, which I will need in my chrome.storage.sync work (bug 1253740).
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
(Assignee)

Comment 3

2 years ago
Hmm, seems like this broke on some stuff. I guess I'll have to look more at this..

Updated

2 years ago
Whiteboard: triaged
(Assignee)

Comment 4

2 years ago
I looked at this more today in between meetings. It seems like https://github.com/Kinto/kinto.js/pull/553#pullrequestreview-3556048 is the change that broke blocklist_signatures. It seems like a member variable on `Collection` used to be populated and is now no longer being populated at all. My question is really: do we even need this member variable? Why are we populating it at all? Why are we populating it at the beginning of sync?

:mgoodwin -- do you think it would be OK for me to change blocklist-clients.js to refer to `yield collection.db.getLastModified()` instead of `collection.lastModified`? You already use this in one place so I'm hoping I can use it here too.

:leplatrem -- do you think it would make sense to get rid of `lastModified` as a property of `Collection`? Alternately, would it make sense to load it during/after construction?
Flags: needinfo?(mgoodwin)
Flags: needinfo?(mathieu)
Clearing review until the test failure is sorted out
(In reply to Ethan Glasser-Camp (:glasserc) from comment #4)
> I looked at this more today in between meetings. It seems like
> https://github.com/Kinto/kinto.js/pull/553#pullrequestreview-3556048 is the
> change that broke blocklist_signatures. It seems like a member variable on
> `Collection` used to be populated and is now no longer being populated at
> all. My question is really: do we even need this member variable? Why are we
> populating it at all? Why are we populating it at the beginning of sync?
> 
> :mgoodwin -- do you think it would be OK for me to change
> blocklist-clients.js to refer to `yield collection.db.getLastModified()`
> instead of `collection.lastModified`? You already use this in one place so
> I'm hoping I can use it here too.

My recollection is that there was some difference between these. I don't recall exactly what. Maybe leplatrem remembers?
Flags: needinfo?(mgoodwin)

Comment 7

2 years ago
>  It seems like a member variable on `Collection` used to be populated and is now no longer being populated at all

The previous implementation in `kinto.js` was not good, it was using this attribute to store some intermediate state during the sync process. 

Now the value should be set at the end of a successful sync process only. 

In our case, here:
https://dxr.mozilla.org/mozilla-central/rev/7452437b3ab571b1d60aed4e973d82a1471f72b2/services/common/blocklist-clients.js#205
we were relying on a value that was not consistently set, because it was assigned in the middle of failing sync process.

Hence, here we want `collection.db.getLastModified()` which is the timestamp of the last successful sync effectively stored in the local DB.
Flags: needinfo?(mathieu)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)

Comment 11

2 years ago
mozreview-review
Comment on attachment 8801362 [details]
Bug 1308515: Fix blocklist-clients.js so that it can work with new kinto.js,

https://reviewboard.mozilla.org/r/86134/#review85032

::: services/common/blocklist-clients.js:206
(Diff revision 1)
>              yield this.validateCollectionSignature(payload, collection, true);
>              // if the signature is good (we haven't thrown), and the remote
>              // last_modified is newer than the local last_modified, replace the
>              // local data
> -            if (payload.last_modified >= collection.lastModified) {
> +            const newLastModified = yield collection.db.getLastModified();
> +            if (payload.last_modified >= newLastModified) {

µnit: instead `newLastModified` I would have put `localLastModified` to match the comment
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
(Assignee)

Comment 15

2 years ago
Oops, looks like I failed to post the comment I wanted to post the first time around. From :leplatrem's comments it sounds like I always want to get the last-modified date from the DB, so I've taken the liberty of making that change as a standalone commit and putting it before the update of the kinto.js library.

The first try builds failed for reasons that don't seem related to what I was working on, so I've rebased everything onto the most up-to-date version of the code and repushed to try.
Comment on attachment 8798880 [details]
Bug 1308515: Update version of kinto.js client to 5.0.0,

https://reviewboard.mozilla.org/r/84266/#review85274
Attachment #8798880 - Flags: review?(MattN+bmo) → review+

Comment 17

2 years ago
mozreview-review
Comment on attachment 8801362 [details]
Bug 1308515: Fix blocklist-clients.js so that it can work with new kinto.js,

https://reviewboard.mozilla.org/r/86134/#review85448
Attachment #8801362 - Flags: review?(mathieu) → review+
(Assignee)

Updated

2 years ago
Keywords: checkin-needed
MozReview says that the first patch doesn't have sufficient reviews to be autolanded. Please resolve that.
Keywords: checkin-needed
Assignee: nobody → eglassercamp
Status: NEW → ASSIGNED
Comment on attachment 8801362 [details]
Bug 1308515: Fix blocklist-clients.js so that it can work with new kinto.js,

https://reviewboard.mozilla.org/r/86134/#review85670

I didn't realize MozReview enforced this.
Attachment #8801362 - Flags: review?(MattN+bmo) → review+

Comment 20

2 years ago
Pushed by mozilla@noorenberghe.ca:
https://hg.mozilla.org/integration/autoland/rev/2e4a60eeb1f0
Fix blocklist-clients.js so that it can work with new kinto.js, r=leplatrem,MattN
https://hg.mozilla.org/integration/autoland/rev/a33f036e3496
Update version of kinto.js client to 5.0.0, r=MattN
(Assignee)

Comment 21

2 years ago
Oops! I forgot that :leplatrem doesn't have high enough privileges to r+ a commit by himself. Thanks :MattN for reviewing the other patch.

Comment 22

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/2e4a60eeb1f0
https://hg.mozilla.org/mozilla-central/rev/a33f036e3496
Status: ASSIGNED → RESOLVED
Last Resolved: 2 years ago
status-firefox52: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla52

Updated

3 months ago
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.