fix(mobile): keep just-created channels visible while membership provisions - #7785
Open
arthur-albuquerque wants to merge 1 commit into
Open
arthur-albuquerque wants to merge 1 commit into
arthur-albuquerque wants to merge 1 commit into
Conversation
…isions (block#7780) The relay provisions the creator's kind:39002 membership entry asynchronously after kind:9007. The mobile channel list is built from kind:39002 memberships plus the open directory, so a refresh that races that write drops the just-created channel entirely — project channels created on Desktop could never appear on iOS. Add a pending-owner overlay to ChannelsNotifier, mirroring Desktop's AppState::pending_owned_channels: - markPendingOwnedChannel records the channel id right after the kind:9007 submission, keyed by relay-and-identity scope - refreshes treat pending ids as members for metadata fetch and isMember classification, so the channel stays listed - each id clears as soon as real kind:39002 membership is observed, so a later leave still flips is_member back to false - a community or identity switch clears the overlay so stale entries can never classify channels in a new scope Signed-off-by: Arthur Albuquerque <arthur_albuquerque1@yahoo.com>
🔐 Codex Security Review
|
This branch has not been deployed
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.
Fixes #7780
Problem
Channels created inside a project (and any other channel created from another client) never appeared in the iOS channel list. The mobile list is built from two sources — the user's kind:39002 memberships and the open-channel directory — and the relay provisions the creator's kind:39002 membership asynchronously after kind:9007. A mobile refresh that lands in that window sees neither a membership entry nor (for private channels) a directory entry, so the channel is dropped from the list permanently. Desktop is unaffected because
AppState::pending_owned_channelsoverlays exactly this gap (desktop/src-tauri/src/app_state_pending_channels.rs).Change
Mirror Desktop's pending-owner overlay on mobile:
ChannelsNotifier.markPendingOwnedChannelrecords the channel id right after the successful kind:9007 submission inChannelActions.createChannel, keyed by relay-and-identity scope._fetchChannelstreats pending ids as members: they are added to the metadata-fetch set and classifiedisMember: true, so the channel stays listed.is_memberback to false and the overlay never masks a genuine removal.Scope note
This fixes the visibility window that made project channels unreachable on iOS. A full Projects surface on mobile (kind:30621 read models, the
buzz-channel/buzz-related-channelbindings) is a separate feature and is intentionally not attempted here.Testing
flutter analyze— no issuesdart format --set-exit-if-changed— cleannode mobile/scripts/check-file-sizes.mjs— cleanflutter test test/features/channels/channels_provider_test.dart— 74 passed, including 3 new regression tests:isMember: true, and its metadata is fetched;flutter test test/features/channels/— 1060 passed.flutter testshows 15 pre-existing failures intest/shared/push/push_presentation_export_test.dart(native MethodChannel mocks); reproduced identically on a clean checkout ofef2aa1awith no changes — unrelated to this PR.Commits are signed off (
git commit -s) per the DCO check.