Skip to content

fix(mobile): refresh channel sections after local mutations - #6194

Open
thesid42 wants to merge 1 commit into
block:mainfrom
thesid42:fix/5797-mobile-channel-section-refresh
Open

fix(mobile): refresh channel sections after local mutations#6194
thesid42 wants to merge 1 commit into
block:mainfrom
thesid42:fix/5797-mobile-channel-section-refresh

Conversation

@thesid42

Copy link
Copy Markdown

Summary

  • notify mobile channel-section observers synchronously after local create, rename, delete, reorder, assign, and unassign mutations
  • schedule debounced relay publication before observer callbacks so callback-triggered disposal still flushes updated state
  • add regression coverage for persistence ordering, exactly-once notifications, move-boundary no-ops, and disposal-time publication

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 analyze
  • node mobile/scripts/check-file-sizes.mjs
  • pnpm run check

Screenshots: Not included. This fixes state propagation and does not change visual styling.

Signed-off-by: thesid42 <siddharthbhat44@gmail.com>
@thesid42
thesid42 requested a review from a team as a code owner August 18, 2026 05:15
Copilot AI lite review requested due to automatic review settings August 18, 2026 05:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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.

Mobile: creating/renaming/deleting a channel section (or moving a channel into one) doesn't update the UI

2 participants