-
Notifications
You must be signed in to change notification settings - Fork 32
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
Failed "login" requests are stored in outbox #90
Comments
Yes, this is a bug. This issue is primarily in wq.app's JS, though the solution might involve adding a data-attribute to the wq.start login.html template. The solution is either to:
|
I rather see this as a special case of |
Good point, this really should be tied to the background sync flag. After thinking about this some more, I think
Option 1 and 4 seem like they should be the main options. Option 2 and 3 seem less useful and I would probably wait to support them until someone needed them for a real use case. |
- don't store form data if wq-background-sync is false (fixes #90) - store form data containing files/blobs under separate localForage keys - fall back to in-memory storage if localForage cannot save form contents - don't attempt to store wq/photo.js blobs until form submission
- don't store form data if wq-background-sync is false (fixes #90) - store form data containing files/blobs under separate localForage keys - don't load blobs for outbox items unless explicitly requested (with new outbox.loadItem() method) - fall back to in-memory storage if localForage cannot save form contents - don't attempt to store wq/photo.js blobs until form submission
There is another variation, which I currently need: The whole storing, syncing, refreshing cycle can be unpredictably slow in weak network conditions and just storing form data for syncing later is a solution for that. Additionally, I can't find a reliable way to test behaviour of the application in the offline state (SeleniumHQ/selenium@7ba13118ac doesn't work as expected, so I reported https://bugs.chromium.org/p/chromium/issues/detail?id=781921). So this variation would unify behaviour across different network conditions and allow testing the application with Selenium. |
I don't think it's documented, but in theory option 5 can be set at the application level by setting config.backgroundSync = false; // Always sync in foreground
config.noBackgroundSync = true; // Always sync in foreground
config.backgroundSync = true; // Background sync, retry every 30 seconds
config.backgroundSync = 60 * 5; // Background sync, retry every 5 minutes
config.backgroundSync = -1; // Sync only on demand (e.g. Sync Now button) This should probably be tested (and thought through a bit more). |
In my fork, when background sync is used, there seems to be a race condition if new records are constantly provided, which results in loss of entries before they are synced. I can reproduce it 100% of times when the form submission cycle is short (like accepting default data) and network connection is slowed down (in Chrome DevTools / Network). Could it be a problem in the way When So it looks like setting |
I think it's a bug, either in wq.app or wq.start, because:
Steps to reproduce:
require('wq/outbox').unsyncedItems().then(function(items){console.log(items[0].data)})
to see the form dataThe text was updated successfully, but these errors were encountered: