Attempt to fix issues with the notifications page state #1109
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request Description
Note
I am going to leave this as a draft for now until I've had a chance to daily drive it.
This PR is an attempt to fix an issue I've been experiencing lately. I haven't been able to reproduce it on the emulator (so no demo vid) but I see it a lot on my phone. Essentially, I'm working my way through notifications, navigating to each comment thread and navigating back to mark the reply as read, and occasionally a read message will reappear in the list after I navigate back from a post.
I believe this is happening because the
InboxRepliesView
is constructed with an initial set of replies, which comes from a query that can include read posts. I'm thinking a rebuild is reconstructing things, instead of relying on the Bloc after the initial build. I believe the fix is to rely entirely on the Bloc and never pass the initial list in. That way, the state management (like removing read replies from the list) should always be accurately represented in the UI. It's possible we could further clean up theInboxRepliesView
, now that we have better state, but I made the minimal changes necessary.Issue Being Fixed
Issue Number: N/A
Screenshots / Recordings
Checklist
semanticLabel
s where applicable for accessibility?