Skip to content

fix(mob): stop retrying older messages in a loop after a failure - #175

Merged
mrsumanbiswas merged 1 commit into
CommandLineCoding:v0.3.5from
mrsumanbiswas:174-bug-older-messages-retry-loop
Nov 7, 2026
Merged

mrsumanbiswas merged 1 commit into
CommandLineCoding:v0.3.5from
mrsumanbiswas:174-bug-older-messages-retry-loop

Conversation

@mrsumanbiswas

Copy link
Copy Markdown
Member

Closes #174.

When GET /api/messages?with=… failed on Elephant Cloud (500 because migration 012 was missing on the production database), an open chat sent about 10 requests per second: 106 in 10 s, measured on a phone with logcat. Each failure ran notifyListeners(), the rebuild hit the scroll listener's "near the top" check, and that called loadMoreMessages() again.

Now a failed page sets hasMoreMessages = false. Paging resumes when the chat is reopened, because openChat resets it.

flutter analyze and flutter test pass.

A failed page load rebuilt the list, and the scroll listener asked for
the same page again straight away, about 10 requests a second for as
long as the chat stayed open. After a failure, stop paging until the
chat is reopened.

Closes CommandLineCoding#174
@mrsumanbiswas
mrsumanbiswas merged commit 9df51fa into CommandLineCoding:v0.3.5 Nov 7, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: Chat retries loading older messages in a tight loop when the request fails

1 participant