fix(mobile): refresh channel sections after local mutations - #6194
Open
thesid42 wants to merge 1 commit into
Open
fix(mobile): refresh channel sections after local mutations#6194thesid42 wants to merge 1 commit into
thesid42 wants to merge 1 commit into
Conversation
Signed-off-by: thesid42 <siddharthbhat44@gmail.com>
There was a problem hiding this comment.
Pull request overview
This PR fixes a mobile UI staleness issue where local channel-section mutations (create/rename/delete/reorder/assign/unassign) were persisted and scheduled for relay publication, but did not synchronously notify Riverpod observers—so the sidebar didn’t rebuild until a later, unrelated update.
Changes:
- Add synchronous
_onChanged()notifications after local mutations, ensuring state observers update immediately. - Ensure debounced relay publication is scheduled before observer callbacks so
onChanged-triggered disposal can still flush pending publication. - Add regression tests covering persistence-before-notify ordering, exactly-once sync notifications, no-op move boundaries, and disposal-time publish flush.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| mobile/lib/features/channels/channel_sections/channel_sections_manager.dart | Calls _onChanged() after local mutations (after persistence + debounced publish scheduling) so UI observers update immediately. |
| mobile/test/features/channels/channel_sections/channel_sections_manager_test.dart | Adds regression coverage for sync notifications, persistence ordering, move no-ops, and disposal-triggered publish flush. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Related issue
Fixes #5797.
Testing
cd mobile && flutter test test/features/channels/channel_sections/channel_sections_manager_test.dart test/features/channels/channel_actions_sheet_test.dart test/features/channels/channels_page_test.dart(57 passed)cd mobile && flutter test(1,467 passed)cd mobile && dart format --output=none --set-exit-if-changed . && flutter analyzenode mobile/scripts/check-file-sizes.mjspnpm run checkScreenshots: Not included. This fixes state propagation and does not change visual styling.