Skip to content

fix(mobile): keep just-created channels visible while membership provisions - #7785

Open
arthur-albuquerque wants to merge 1 commit into
block:mainfrom
arthur-albuquerque:fix/ios-project-channel-visibility
Open

arthur-albuquerque wants to merge 1 commit into
block:mainfrom
arthur-albuquerque:fix/ios-project-channel-visibility

Conversation

@arthur-albuquerque

Copy link
Copy Markdown

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_channels overlays exactly this gap (desktop/src-tauri/src/app_state_pending_channels.rs).

Change

Mirror Desktop's pending-owner overlay on mobile:

  • ChannelsNotifier.markPendingOwnedChannel records the channel id right after the successful kind:9007 submission in ChannelActions.createChannel, keyed by relay-and-identity scope.
  • _fetchChannels treats pending ids as members: they are added to the metadata-fetch set and classified isMember: true, so the channel stays listed.
  • Each pending id is cleared as soon as real kind:39002 membership is observed, so a later leave still flips is_member back to false and the overlay never masks a genuine removal.
  • A community or identity switch clears the overlay with the other scope-scoped state, so stale entries can never classify channels in a new scope.

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-channel bindings) is a separate feature and is intentionally not attempted here.

Testing

  • flutter analyze — no issues
  • dart format --set-exit-if-changed — clean
  • node mobile/scripts/check-file-sizes.mjs — clean
  • flutter test test/features/channels/channels_provider_test.dart — 74 passed, including 3 new regression tests:
    1. a pending channel with no kind:39002 entry stays listed with isMember: true, and its metadata is fetched;
    2. the overlay clears once real membership lands, so a later membership removal drops the channel (no permanent mask);
    3. the overlay does not leak across an identity switch.
  • Full flutter test test/features/channels/ — 1060 passed.
  • Full flutter test shows 15 pre-existing failures in test/shared/push/push_presentation_export_test.dart (native MethodChannel mocks); reproduced identically on a clean checkout of ef2aa1a with no changes — unrelated to this PR.

Commits are signed off (git commit -s) per the DCO check.

…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>
@arthur-albuquerque
arthur-albuquerque requested a review from a team as a code owner September 21, 2026 17:44
Copilot AI lite review requested due to automatic review settings September 21, 2026 17:44

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown

🔐 Codex Security Review

Status: review required for the current range.

The current range is a61239f0d8036aff58176f5c0ce7f080c66e21b7...5518fa304856299d6801d045c5bd4bb6ceae69ae.
A new review must complete for this exact range. When manual authorization
is required, a Block organization member must comment exactly
@buzz-security-review 5518fa304856299d6801d045c5bd4bb6ceae69ae to authorize a new review.
Any previous review applies only to its recorded range.

This branch has not been deployed

No deployments
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.

iOS: channels created within a project never appear in the mobile channel list (no projects surface, no pending-owner overlay)

2 participants