Skip to content

fix(web): move spaces sync to the Nov 5 alpha so full repo downloads read again - #538

Merged
botandbang merged 2 commits into
mainfrom
bnb/spaces-alpha-nov-5
Nov 9, 2026
Merged

botandbang merged 2 commits into
mainfrom
bnb/spaces-alpha-nov-5

Conversation

@botandbang

@botandbang botandbang commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Production sync has been failing on full repo downloads from the hosted spaces alpha. The repos in the staff space (at://did:plc:d42l64gsczg6qh2vo243xv5l/space/computer.localnetwork.space.staff/main) and an EPK space don't sync. A production sync of the staff space at 2026-11-09T19:31:30Z failed with RepoVerificationError: invalid NSID in record path: /, thrown from the Oct 29 verifyRepoStarFull, and the EPK space fails with invalid record path: &. The host already runs the Nov 5 alpha, whose STAR archives put a 0x01 byte before each record and end with 0x00 (atproto#5808). Our Oct 29 reader takes the 0x01 as a key length of one, so the "path" it reports is the real path's length byte (& is 38, / is 47). Reading a Nov 5 archive with both versions of @atproto/space locally gives the same error from the Oct 29 reader, and the Nov 5 reader returns the records.

Changed

  • Every @atproto/* and @atproto-labs/* package, in apps/web and in the workspace overrides, moves from 0.0.0-spaces-alpha-20261029171913 to 0.0.0-spaces-alpha-20261105160032. @atproto/star is new in this release and comes in through @atproto/space. It joins the overrides because its caret range would otherwise resolve to 0.0.0-stage, which sorts above the alpha. Our code doesn't import any of the STAR exports the Nov 5 migration notes move or remove, so the upgrade needs no import changes.
  • isMacFailure in apps/web/src/lib/server/atproto/credentials.ts now counts only SpaceMacError. It used to count every RepoVerificationError, which verifyRepoStar throws both for a commit that fails its MAC and for an archive that doesn't parse. So a parse error got logged as "MAC did not verify; retrying with a refreshed KEM key", followed by a second download that couldn't help. A full download in apps/web/src/lib/server/sync/engine.ts now reads the archive with readRepoStar and checks the commit with verifyCommit, throwing SpaceMacError the way the oplog path already did. Any other failure fails the repo with the reader's own message and goes through the existing retry and backoff.
  • A writer whose repo host answers RepoTakendown, RepoSuspended or RepoDeactivated is skipped. There's no fallback to a full download, and the pass no longer fails on its account. The repo keeps its retry row, so it's tried again on the usual backoff and picked up once the account is back. /admin/system shows the error on the space and on the repo.
  • /admin/system lists a repo that has never synced under its space, as "never synced" with its error. Before, such a repo had no line and only the space's error said anything about it. SpaceSyncer.status() adds those repos from syncRepoRetry, with no rev or sync time. A repo's error also gets its " · " separator back: Svelte trimmed the leading space inside the span, so a synced repo with an error read @ rev· error.
  • The README names the new alpha and describes how taken-down writers and suspended spaces are handled.

Added

  • Engine tests against the test space host. They check that it now serves the new framing and that the syncer reads it. An archive cut off before its end byte, or with a record path that isn't one, fails the repo with the reader's error and no KEM refresh. A full download that fails its MAC still refreshes the KEM key once. Each of the three writer errors gets skipped without failing the pass. A space whose authority answers RepoTakendown or RepoDeactivated from listRepos or getSpaceCredential keeps its local copy (atproto#5810: that only suspends the space). That last behaviour already worked and had no tests. Two more tests cover the system page: one that status() reports a repo that never synced, and one for the page lines of a synced repo and a never-synced one with its error.

Removed

  • The RepoVerificationError import from credentials.ts and the verifyRepoStarFull call in the engine.

The live host wasn't checked from a local server. Reading a production space needs the production root account's session, and a pass also calls registerNotify, so there's no read-only way to run one against it.

Fixes LOC-271

Since the Nov 5 alpha (bluesky-social/atproto#5808) the hosted spaces alpha puts a control byte before each record in a STAR archive and ends the archive with another. The Oct 29 reader can't read that framing, so every full repo download failed with errors like "invalid record path: &", where the path it reports is really a length byte.

This pins every @atproto and @atproto-labs package to 0.0.0-spaces-alpha-20261105160032. @atproto/space now depends on the new @atproto/star package, which joins the overrides: its caret range would otherwise resolve to 0.0.0-stage, which sorts above the alpha.
…n writers

isMacFailure counted every RepoVerificationError as a MAC failure. verifyRepoStar throws that error for an archive that doesn't parse as well as for a commit that fails its MAC, so a parse error got a KEM key refresh and a second download that couldn't help, and the log said the MAC didn't verify. A full download now reads the archive with readRepoStar and checks the commit with verifyCommit, throwing SpaceMacError as the oplog path does, and only SpaceMacError counts as a MAC failure. Anything else fails the repo with the reader's own message and goes through the usual retry and backoff.

A writer whose repo host answers RepoTakendown, RepoSuspended or RepoDeactivated is skipped: no fallback to a full download, and the pass doesn't fail on its account. The repo keeps its retry row, so it's tried again on the usual backoff and picked up once the account is back, and the system page shows the error on the space and on the repo. A repo that has never synced now gets a line of its own there too ("never synced" and its error), where before only the space's error said anything about it, and a repo's error is set off by " · " again. The same errors from getSpaceCredential or listRepos (bluesky-social/atproto#5810) mean the authority is taken down or deactivated, which only suspends the space. The pass stops as before and the local copy stays, now with tests that check it.
@botandbang
botandbang requested a review from bnb as a code owner November 9, 2026 22:56
@github-actions github-actions Bot added documentation Improvements or additions to documentation dependencies Pull requests that update a dependency file web The Local Network website (apps/web) web: staff Admin, moderation and the audit log web: server Spaces, sync, HappyView, the database and the server around them tests Tests, fixtures and test harnesses tooling Repo config, lint and build tooling, and GitHub settings labels Nov 9, 2026
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatednpm/​@​atproto-labs/​handle-resolver-node@​0.0.0-spaces-alpha-20261029171913 ⏵ 0.0.0-spaces-alpha-202611051600321001006499 +1100
Updatednpm/​@​atproto-labs/​did-resolver@​0.0.0-spaces-alpha-20261029171913 ⏵ 0.0.0-spaces-alpha-202611051600321001006698 +1100
Updatednpm/​@​atproto-labs/​fetch-node@​0.0.0-spaces-alpha-20261029171913 ⏵ 0.0.0-spaces-alpha-202611051600321001006798 +1100
Updatednpm/​@​atproto/​oauth-scopes@​0.0.0-spaces-alpha-20261029171913 ⏵ 0.0.0-spaces-alpha-2026110516003293 -21007199 +1100
Updatednpm/​@​atproto/​space@​0.0.0-spaces-alpha-20261029171913 ⏵ 0.0.0-spaces-alpha-2026110516003284 +21007397 +1100
Updatednpm/​@​atproto/​common-web@​0.0.0-spaces-alpha-20261029171913 ⏵ 0.0.0-spaces-alpha-202611051600321001007599 +1100
Updatednpm/​@​atproto/​lex-cbor@​0.0.0-spaces-alpha-20261029171913 ⏵ 0.0.0-spaces-alpha-20261105160032100 +11007699 +1100
Updatednpm/​@​atproto/​lex-json@​0.0.0-spaces-alpha-20261029171913 ⏵ 0.0.0-spaces-alpha-202611051600321001007799 +1100
Updatednpm/​@​atproto/​lex-data@​0.0.0-spaces-alpha-20261029171913 ⏵ 0.0.0-spaces-alpha-202611051600321001007899 +2100
Updatednpm/​@​atproto/​lex-resolver@​0.0.0-spaces-alpha-20261029171913 ⏵ 0.0.0-spaces-alpha-20261105160032991007899100
Updatednpm/​@​atproto/​identity@​0.0.0-spaces-alpha-20261029171913 ⏵ 0.0.0-spaces-alpha-2026110516003297 +21008399 +1100
Updatednpm/​@​atproto/​dev-env@​0.0.0-spaces-alpha-20261029171913 ⏵ 0.0.0-spaces-alpha-2026110516003287 +41008599 +1100
Updatednpm/​@​atproto/​crypto@​0.0.0-spaces-alpha-20261029171913 ⏵ 0.0.0-spaces-alpha-20261105160032100 +11008599 +1100
Updatednpm/​@​atproto/​lexicon@​0.0.0-spaces-alpha-20261029171913 ⏵ 0.0.0-spaces-alpha-202611051600321001008599 +1100
Updatednpm/​@​atproto/​sync@​0.0.0-spaces-alpha-20261029171913 ⏵ 0.0.0-spaces-alpha-2026110516003289 +41009899 +1100
Updatednpm/​@​atproto/​syntax@​0.0.0-spaces-alpha-20261029171913 ⏵ 0.0.0-spaces-alpha-202611051600321001009499 +1100
Updatednpm/​@​atproto/​oauth-client-node@​0.0.0-spaces-alpha-20261029171913 ⏵ 0.0.0-spaces-alpha-202611051600321001009999 +1100
Updatednpm/​@​atproto/​api@​0.0.0-spaces-alpha-20261029171913 ⏵ 0.0.0-spaces-alpha-20261105160032100100100 +199100

View full report

@botandbang botandbang added the no-issue No issue to link, so the PR issue check passes label Nov 9, 2026
@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Coverage Report for apps/web

Status Category Percentage Covered / Total
🟢 Lines 99.77% (🎯 99%)
🟰 ±0 pp
11079 / 11104
🟢 Statements 99.46% (🎯 99%)
🟰 ±0 pp
16977 / 17068
🟢 Functions 99.63% (🎯 99%)
⬆️ +0.01 pp
4578 / 4595
🟢 Branches 94.68% (🎯 94%)
⬇️ -0.01 pp
8247 / 8710
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
apps/web/src/lib/server/atproto/credentials.ts 100%
🟰 ±0 pp
100%
🟰 ±0 pp
100%
🟰 ±0 pp
100%
🟰 ±0 pp
apps/web/src/lib/server/sync/engine.ts 100%
🟰 ±0 pp
99.25%
⬆️ +0.05 pp
100%
🟰 ±0 pp
100%
🟰 ±0 pp
Generated in workflow #613 for commit 0f72a32 by the Vitest Coverage Report Action

Size

Compared with main. KiB are 1,024 bytes.

This pull request main Change
Client JavaScript 806.1 KiB 806.1 KiB +29 B (+0%)
Client JavaScript, brotli 272.1 KiB 272.1 KiB -12 B (-0%)
Client CSS 99.1 KiB 99.1 KiB 0 B (0%)
Client CSS, brotli 14.2 KiB 14.2 KiB 0 B (0%)

@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Coverage Report for apps/localtoolbox

Status Category Percentage Covered / Total
🟢 Lines 100% (🎯 100%)
🟰 ±0 pp
4461 / 4461
🟢 Statements 100% (🎯 100%)
🟰 ±0 pp
6041 / 6041
🟢 Functions 100% (🎯 100%)
🟰 ±0 pp
1762 / 1762
🟢 Branches 98.6% (🎯 50%)
🟰 ±0 pp
2889 / 2930
File CoverageNo changed files found.
Generated in workflow #613 for commit 0f72a32 by the Vitest Coverage Report Action

Size

Compared with main. KiB are 1,024 bytes.

This pull request main Change
Packaged (localtoolbox.zip) 360.3 KiB 360.3 KiB +3 B (+0%)
Unpacked (dist/) 810.8 KiB 810.8 KiB 0 B (0%)

@botandbang
botandbang added this pull request to the merge queue Nov 9, 2026
@botandbang botandbang removed the no-issue No issue to link, so the PR issue check passes label Nov 9, 2026
@linear-code

linear-code Bot commented Nov 9, 2026

Copy link
Copy Markdown

LOC-271

Merged via the queue into main with commit 5553758 Nov 9, 2026
26 checks passed
@botandbang
botandbang deleted the bnb/spaces-alpha-nov-5 branch November 9, 2026 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation tests Tests, fixtures and test harnesses tooling Repo config, lint and build tooling, and GitHub settings web: server Spaces, sync, HappyView, the database and the server around them web: staff Admin, moderation and the audit log web The Local Network website (apps/web)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants