-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #68 - Handle Backoff header. #82
Conversation
I just realized we need a request queue in order to avoid getting a disordered requests chain when the backoff release timestamp is reset. That's slightly more complicated than initially expected; I wish we'll actually use that feature :) |
This is really a bunch of work; especially, we'd need to think what are the consequences of not having the response immediately while requests are queued, and what happens precisely when a bunch of them are performed when the backoff release timestamp is reached. A very simple solution would be to simply trigger and error when a Backoff header is received, and that would be developers' responsibility to hold on performing more requests and/or handling the queuing by themselves. I'm voting for the latter, though would love getting some feedback :) |
Actually the Backoff is not an error. IMHO it is better not to do anything (like queuing or stopping requests) rather than raising error. |
After discussion, here's the new plan:
|
@Natim r=? |
@@ -589,12 +589,18 @@ export default class Collection { | |||
* Conflicting server records will be overriden with local changes. | |||
* * `Collection.strategy.MANUAL`: | |||
* Conflicts will be reported in a dedicated array. | |||
* - {Boolean} forceBackoff: Force synchronization even if server is currently |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe ignoreBackoff
is better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's better indeed, will update.
@Natim r=? regarding your comments. I'll update this patch to allow running integration tests against a kinto server instance configured to send Backoff headers, for safety. Hold on merging in the meanwhile. |
Note that this patch embeds a fix for Kinto/kinto#148; We could land this as is and remove the fix when the related issue is closed, or wait for a new kinto version to be released (I really want to rely on stable releases for tests). |
r+ I agree we should not wait on Kinto/kinto#148 to land this PR |
Fixes #68 - Handle Backoff header.
r=? @leplatrem @Natim