Skip to content

feat(communities): add relays saved by the previous buzz app - #1786

Open
kalvinnchau wants to merge 10 commits into
mainfrom
peon/legacy-relay-import
Open

kalvinnchau wants to merge 10 commits into
mainfrom
peon/legacy-relay-import

Conversation

@kalvinnchau

@kalvinnchau kalvinnchau commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Offer to import communities saved by the previous Buzz desktop app for the signed-in identity. Every nonempty import requires explicit consent because current account state cannot establish whether old communities were previously removed. The prompt lists eligible origins and warns that importing may restore removed communities. Declining persists the decision.

The native reader opens the old macOS WebKit databases read-only, skips symlinks and propagates traversal/database errors so failures remain retryable. Only an absent root reads as empty. Import preserves existing settings and memberships and checks current state again after consent.

Test scope

At the author's explicit request, keep only one small importer test for this one-time startup migration. It checks that nothing is written before consent, approval adds the community and upload intent, and the completion marker prevents another read. Migration-specific test code drops from 734 lines to 56.

Remove the native fixtures, importer scenario matrix, dialog suite and added startup test. The previously added browser journey is also removed; no shared browser-build infrastructure is added. Native parsing/traversal, removal/sync permutations, retries, dismissal/lifecycle and app/browser integration no longer have dedicated migration regression coverage. Prior checks remain historical evidence, not permanent coverage. This deliberately accepts that coverage tradeoff to reduce ongoing test maintenance and execution for a one-time feature.

Validation

  • The remaining importer test passed locally in a 533ms Vitest run.
  • This follow-up changes test code only. Production migration behavior is unchanged.
  • Mandatory commit/push hooks passed at afe0beb90. Latest-head CI run 40743552194 is pending for this reduction. Independent review approved the change with no findings. The prior head 3ddb185f7 passed CI run 40737395802.

Native GUI/IPC/OS-path acceptance and live relay reconnect remain unobserved. Optional skipped-entry diagnostics and importer simplification remain deferred.

kalvinnchau and others added 5 commits October 27, 2026 20:42
read the previous app's webkit localstorage community list read-only
through a native command, and add its secure relays to each viewer's
memberships once through the known-communities write. existing
memberships and queued removals are kept; a per-viewer marker keeps
later removals from being undone.

Co-authored-by: peon <9ac6794b000690b7e814eb1805ad32405d0bec7d52838de3a86cf967565dacc0@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Kalvin Chau <kalvin@block.xyz>
return each saved community's recorded pubkey from the native reader and
import only the ones saved for the current viewer. remember memberships
held while the import runs so one left during the read stays gone after
its removal is acknowledged. the disposer abandons a read in flight.
start the import from the native app composition.

Co-authored-by: peon <9ac6794b000690b7e814eb1805ad32405d0bec7d52838de3a86cf967565dacc0@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Kalvin Chau <kalvin@block.xyz>
record every removal each viewer queues while the import runs, alongside
the memberships it holds, so a relay whose queued removal is acknowledged
during the native read is not restored.

Co-authored-by: peon <9ac6794b000690b7e814eb1805ad32405d0bec7d52838de3a86cf967565dacc0@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Kalvin Chau <kalvin@block.xyz>
…port

until the import finishes, store the removal addresses it has seen under
the per-viewer marker and seed them on the next launch, so a relay whose
removal was acknowledged after a failed read or save is not restored when
the import retries.

Co-authored-by: peon <9ac6794b000690b7e814eb1805ad32405d0bec7d52838de3a86cf967565dacc0@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Kalvin Chau <kalvin@block.xyz>
mark the observed removal history unsaved when it grows and retry the
write on each observation until it succeeds, so a removal whose first
progress write failed is still kept once storage recovers.

Co-authored-by: peon <9ac6794b000690b7e814eb1805ad32405d0bec7d52838de3a86cf967565dacc0@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Kalvin Chau <kalvin@block.xyz>
@kalvinnchau
kalvinnchau marked this pull request as ready for review October 28, 2026 03:44
@kalvinnchau
kalvinnchau requested a review from a team as a code owner October 28, 2026 03:44

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 Carl, an automated reviewer, commenting via Wes's GitHub account.

Verdict: one blocker and one product decision before merge. Reviewed head 10fc185 against main 6405ec8. The Royal Court split it into three lanes: native reader, importer, and an independent challenge.

Holds up:

  • The importer computes and applies its sync state with no await in between, so it cannot clobber the Builderlab owner's acknowledgements.
  • Interior symlinks are skipped, and the command takes no path argument.
  • A targeted probe read committed UTF-16LE data while a WAL writer held an exclusive transaction.

Merge criteria

  1. Traversal errors fail the read instead of completing the import (inline, legacy_communities.rs).
  2. Decide whether the import may re-add relays the user already removed, and gate it if not (inline, legacy-communities.ts:110).
  3. Run a real migration from an installed old Buzz once. Today's tests use fixture SQLite layouts that bypass root(), so WebKit discovery and the on-disk format are unproven.

The other inline comments are optional. CI is green at this head. Per this repo's AGENTS.md, this review is posted as a comment and not as Request Changes.

Comment thread src-tauri/src/legacy_communities.rs Outdated
Comment thread src/features/communities/legacy-communities.ts
Comment thread src/features/communities/legacy-communities.ts
Comment thread src/app/services.ts Outdated
Comment thread src/features/communities/legacy-communities.ts
kalvinnchau and others added 5 commits October 28, 2026 09:35
fail the legacy read on directory, entry, and file type errors while
allowing only a missing root to read as empty. preserve symlink skipping
and cover access recovery and importer retry after a rejected read.

Co-authored-by: am <6e30cd56c30e030cd31bb0939b94a7c257c9a09d5ba2d92cf2735da45629f248@buzz.block.builderlab.xyz>
Signed-off-by: Kalvin Chau <kalvin@block.xyz>
require approval for every nonempty legacy import because account state
cannot prove that acknowledged removals never existed. offer the saved
origins after launch and remember a declined import without adding or
queueing communities. recheck current membership and sync state after
consent, preserving edits made while the prompt is open.

cover acknowledged removals, uncertain account sync, dialog disposal,
native app wiring, and browser startup focus with reload persistence.

Co-authored-by: am <6e30cd56c30e030cd31bb0939b94a7c257c9a09d5ba2d92cf2735da45629f248@buzz.block.builderlab.xyz>
Signed-off-by: Kalvin Chau <kalvin@block.xyz>
set the storage event source so appearance applies the requested scale and assert the computed root size before checking keyboard reachability.

Co-authored-by: am <6e30cd56c30e030cd31bb0939b94a7c257c9a09d5ba2d92cf2735da45629f248@buzz.block.builderlab.xyz>
Signed-off-by: Kalvin Chau <kalvin@block.xyz>
remove the whole-app browser journey and duplicate dismissal cases.
retain native traversal, consent, removal and retry regressions in the
existing unit and component layers without expanding browser fixtures.

Co-authored-by: am <6e30cd56c30e030cd31bb0939b94a7c257c9a09d5ba2d92cf2735da45629f248@buzz.block.builderlab.xyz>
Signed-off-by: Kalvin Chau <kalvin@block.xyz>
remove native fixtures, importer permutations, dialog tests and the
startup test at the author's request. retain only consent gating and
the one-time completion check without changing production behavior.

Co-authored-by: am <6e30cd56c30e030cd31bb0939b94a7c257c9a09d5ba2d92cf2735da45629f248@buzz.block.builderlab.xyz>
Signed-off-by: Kalvin Chau <kalvin@block.xyz>
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.

2 participants