Commit f4dc515
committed
store: Retry registerQueue on failure
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: #5561 parent ba46924 commit f4dc515
2 files changed
+46
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
605 | 605 | | |
606 | 606 | | |
607 | 607 | | |
608 | | - | |
| 608 | + | |
609 | 609 | | |
610 | 610 | | |
611 | 611 | | |
| |||
628 | 628 | | |
629 | 629 | | |
630 | 630 | | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
631 | 647 | | |
632 | 648 | | |
633 | 649 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
153 | 152 | | |
154 | 153 | | |
155 | 154 | | |
| |||
173 | 172 | | |
174 | 173 | | |
175 | 174 | | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
176 | 204 | | |
177 | 205 | | |
178 | 206 | | |
| |||
0 commit comments