You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In addition to the test this adds, I wanted to manually test it
end-to-end, to help be sure this covered the scenario where this
retry is known to be needed in the wild:
* The app is offline for a while, perhaps because the device
is asleep.
* The app comes online, tries polling, and finds the event queue
has expired, so it attempts a re-register.
* Before that completes (which after all takes several seconds
if the realm is a large one), the app goes offline again.
* That request's response therefore never reaches the app,
and so when it eventually comes back online it needs to retry.
Step 1 is annoying to carry out literally, because it means
waiting 10 minutes for the event queue to expire. To work around
that, I sabotaged the getEvents binding function to use a wrong
`queue_id` value:
'queue_id': RawParameter('wrong' + queueId),
so that the server would always respond with a BAD_EVENT_QUEUE_ID
error, just the same as if the queue had expired.
Then to take the app offline and online again, I just turned
airplane mode on and off on my device. Because I used a
physical device connected to my computer over USB, that caused
no interference to my watching the logs on the console.
In my manual testing, the retries worked perfectly: no matter
how many times I turned airplane mode on and off, or with what
timing, the app always returned to getting a fresh queue and
polling it for events.
Fixes: #556
0 commit comments