Open PIG208 opened 2 weeks ago
(Rerunning CI.)
(Working on another update to address a potential race; don't review yet)
The PR has been updated with the proposed changes, and additionally, a check for this.generation == generation
to avoid potential races after adding _updateEndMarkers
and notifyListeners
to the backoff callback.
I have also moved the backoff machine variable, renamed to _fetchOlderCooldownBackoffMachine
with Cooldown
as a noun, to _MessageSequence
right next to fetchOlderCoolingDown
, because they are relevant to each other. The backoff machine does not have a public getter and we keep it private.
The loading indicator change might be out of scope for this PR, and we should work on that as a follow-up.
Looks like CI is failing, could you take a look?
Updated the PR. Thanks!
This approach is different from how a BackoffMachine is typically used, because the message list doesn't send and retry requests in a loop; its caller retries rapidly on scroll changes, and we want to ignore the excessive requests.
The test drops irrelevant requests with
connection.takeRequests
without checking, as we are only interested in verifying that no request was sent.Fixes: #945