Skip to content

Delete dead Pro residue: sync:* log listeners and the Recovered Items seed script #3328

Closed

Description

@mstomar125

Summary

Delete two pieces of Pro residue that nothing uses:

  • the log-only sync:error and sync:status listeners in initializeTauriSyncListeners();
  • scripts/seed-recovered-item.ts, a dev script written for a Pro "Recovered Items" UI that core no longer has.

This issue absorbs #3328, which deleted the same script. #3336 no longer lists it.

Neither change needs a nodespace-sync counterpart or the pin gate, because the Pro build uses neither. Part of #3333 (ADR-081, proposed).

Context

Line numbers are at main @ af8ddb6. If they have shifted, locate the code by the quoted symbol.

The listeners

initializeTauriSyncListeners() in packages/desktop-app/src/lib/services/tauri-sync-listener.ts registers listen('sync:error', …) and listen('sync:status', …) at lines 538-550. Both only log.

  • sync:error: nothing emits it, neither core's Rust nor the dev proxy.
  • sync:status: only the Pro command layer emits it (src-tauri/src/commands/pro_sync.rs), with the payload {state, detail, user_email, database_id}.
    • The listener reads payload.status and payload.reason, so it logs Sync status: undefined.
    • The Pro sync store has its own sync:status listener, so the Pro app loses nothing.

The script

scripts/seed-recovered-item.ts (lines 1-165) appends a synthetic entry to ~/.nodespace/recovered-items-<user>.jsonl, so that the Pro Recovered Items UI could be smoke-tested.

  • That store and its badge were already deleted. Comments in three files record the deletion, all under packages/desktop-app/src/lib:
    • stores/conflicts.svelte.ts:53;
    • components/conflict-indicator-badge.svelte:9;
    • components/layout/app-shell.svelte:74.
  • No package.json script, workflow, doc or test references the script.
  • CLAUDE.md prefers deleting a one-off script once its purpose is served.
  • A copy under .claude/worktrees/_gate/ belongs to the merge gate's checkout and is not a reference. Exclude .claude when searching.

Scope

  • packages/desktop-app/src/lib/services/tauri-sync-listener.ts:
    • Delete both listeners and their comments (lines 538-550), plus one adjacent blank line.
    • Leave the log.info('Real-time sync listeners initialized successfully') line, the burst coalescing and every other listener untouched.
  • packages/desktop-app/src/tests/services/tauri-sync-listener.test.ts:
  • scripts/seed-recovered-item.ts: delete the file.
  • scripts/check-pro-boundary.ts: lower BASELINES to the counts the CLI prints.

Out of scope

Steps

  1. Startup, per core's CLAUDE.md:
    • On the primary checkout, run git status, then git fetch origin && git pull origin main.
    • Run EnterWorktree({name: "issue-<N>-pro-residue-cleanup"}).
    • Inside the worktree, run bun install, then bun run test for the baseline.
    • Run bun run gh:comment <N> "Frontend: X passed", bun run gh:assign <N> "@me" and bun run gh:status <N> "In Progress".
  2. Delete the two listeners from tauri-sync-listener.ts.
  3. Update the two test locations described under Scope.
  4. Run git rm scripts/seed-recovered-item.ts.
  5. Check for leftovers:
  6. Run bun run scripts/check-pro-boundary.ts and paste the printed BASELINES block into scripts/check-pro-boundary.ts.
    • At af8ddb6, this change alone lowers proEvents by 6, proWording by 2 and cloudWording by 1.
    • Take the real numbers from the CLI.
  7. Finish:
    • Run bun run test:changed. The diff reaches scripts/, so the scripts tier runs.
    • Run bun run test:scripts and bun run quality:scripts:check.
    • Run bun run --cwd packages/desktop-app quality:fix, then commit.
    • Run git push origin HEAD:issue-<N>-pro-residue-cleanup. The push runs lint only.
    • Run gh pr create --repo NodeSpaceAI/nodespace-core --base main --head issue-<N>-pro-residue-cleanup, then bun run gh:status <N> "In Review".
    • Run /pragmatic-code-review, then /address-review.
    • Merge only after the user approves. Run bun run merge <PR#> in the background, then ExitWorktree.

Standards:

  • Run tests with bun run test, never bun test.
  • No lint suppression.
  • No GitHub issue numbers in code comments.

Acceptance criteria

  • tauri-sync-listener.ts registers no sync:error or sync:status listener.
  • The registration test no longer lists sync:* events, and the two log-only tests are gone.
  • scripts/seed-recovered-item.ts is deleted, and the search in step 4 finds nothing.
  • BASELINES in scripts/check-pro-boundary.ts is lowered to the printed counts, and bun run scripts/check-pro-boundary.ts exits 0.
  • bun run test:changed, bun run test:scripts, bun run quality:scripts:check and bun run --cwd packages/desktop-app quality:fix all pass.

Tests and verification

  • bun run --cwd packages/desktop-app test src/tests/services/tauri-sync-listener.test.ts
  • bun run test:scripts, which includes Add the Pro-boundary ratchet check and the CLAUDE.md Pro/sync placement rule #3299's real-repo ratchet test.
  • bun run quality:scripts:check. tsc -p scripts/tsconfig.json no longer sees the script.
  • bun run test:changed
  • No manual check is needed, because neither listener has a visible effect.

Dependencies

Risks and rollback

  • Risk: Pro debug logs lose one line, which already printed undefined. Nothing changes functionally for the free or the Pro app.
  • Rollback: revert the PR. The revert also restores the previous baselines.

Plan key: C6.1 (pro-boundary DAG).

🤖 Generated with Claude Code

Activity

  1. self-assigned this
    on Sep 30, 2026
  2. added
    pro-boundary
    on Sep 30, 2026
  3. mstomar125 commented on Sep 30, 2026

    @mstomar125
    ContributorAuthor

    Frontend after change: test:changed passed (frontend Happy-DOM, scripts, browser tiers); tauri-sync-listener.test.ts 50 passed. PR: #3373. Ratchet script not on main yet; delta proEvents -6, proWording -2, cloudWording -1 documented in the PR.

  4. added a commit that references this issue on Sep 30, 2026
    bf96b57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

pro-boundary

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions