Skip to content

appview: stop resolving #identity events from the relay firehose - #263

Merged
DGaffney merged 1 commit into
mainfrom
fix/relay-firehose-exclude-identity
Nov 30, 2026
Merged

DGaffney merged 1 commit into
mainfrom
fix/relay-firehose-exclude-identity

Conversation

@DGaffney

@DGaffney DGaffney commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Why

Follow-up to #262. With the cause logged, the AppView error flood from 2026-11-30 reads:

relay-firehose error: error in parsing and authenticating firehose event cause=AbortError: This operation was aborted repo=did:plc:32d2… seq=…

Every line is a timed-out lookup, and the repos are ordinary bsky.social accounts with no cocore records. In @atproto/sync 0.2.2, parseIdentity resolves the DID document and verifies the handle over the network for every #identity event on the relay. Non-matching commits return before key resolution, and #account / #sync parse without network, so identity events are the only path that does this for non-cocore repos.

The AppView's handleEvent ignores identity events, so those lookups are pure cost. A bulk identity wave upstream turned them into dozens of timeouts per second, coinciding with the heap OOM going from weekly to every ~2.5h.

What

excludeIdentity: true on the @atproto/sync Firehose.

#account and #sync are deliberately left on: filtered commits never reach handleEvent, so those two event types are what keep lastEventAt (relay liveness) fresh.

Not established

That this stops the heap growth. It removes the lookup flood; the slow weekly leak predates it and may be separate. Heap needs watching after deploy.

Testing

  • oxfmt --check, tsc -p . --noEmit in packages/appview — clean
  • vitest run src/indexer/relay-firehose.test.ts — 6 passed
  • The rest of the appview suite could not run locally (the better-sqlite3 native module was not built for the local Node), so CI is the check for those

🤖 Generated with Claude Code

@atproto/sync resolves the DID document (and verifies the handle) over the
network for every #identity event on the relay. The AppView discards those
events, so the lookups are pure cost. The cause logging from #262 showed the
2026-11-30 error flood was exactly this: AbortError (3s PLC timeout) for
ordinary bsky.social repos, dozens per second, alongside a heap OOM every
~2.5h. #account and #sync stay enabled; they parse without network and keep
the relay liveness timestamp fresh.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@railway-app

railway-app Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

🚅 Deployed to the cocore-pr-263 environment in co/core

Service Status Web Updated
Client ✅ Success (View Logs) Web Nov 30, 2026 at 7:06 pm UTC
AppView ✅ Success (View Logs) Web Nov 30, 2026 at 7:06 pm UTC
Advisor ✅ Success (View Logs) Web Nov 30, 2026 at 7:05 pm UTC
4 services not affected by this PR
  • Postgres
  • cocore-mdm-gateway
  • cocore-nanomdm
  • cocore-step-ca

@railway-app
railway-app Bot temporarily deployed to co/core / cocore-pr-263 November 30, 2026 19:04 Destroyed
@github-actions

Copy link
Copy Markdown

🛠️ Provider build (macOS arm64) — menu-bar app + CLI

Built from e90d2c0. The tarball bundles cocore.app (the menu-bar/tray app) plus the bare cocore CLI.

🔌 Pre-wired to this PR's stack — the app defaults to https://client-cocore-pr-263.up.railway.app + wss://advisor-cocore-pr-263.up.railway.app/v1/agent (overridable in Settings → Network).

⬇️ cocore-mac-arm64-pr263-e90d2c0.tar.gz

(GitHub artifact — requires being signed in to this repo. The zip contains the .tar.gz + its .sha256.)

tar -xzf cocore-mac-arm64*.tar.gz && cd cocore-mac-arm64
./install.sh   # installs cocore.app to /Applications + the CLI, launches the tray

⚠️ Ad-hoc signed (not notarized) — but install.sh clears the Gatekeeper quarantine for you, so it launches without the "unidentified developer" block. (If you drag the .app in by hand instead, run xattr -dr com.apple.quarantine /Applications/cocore.app yourself first.)

CLI only? It's wired to this PR's stack too:

./bin/cocore agent pair  --console https://client-cocore-pr-263.up.railway.app
./bin/cocore agent serve --advisor wss://advisor-cocore-pr-263.up.railway.app/v1/agent

@DGaffney
DGaffney merged commit af2993b into main Nov 30, 2026
10 checks passed
@DGaffney
DGaffney deleted the fix/relay-firehose-exclude-identity branch November 30, 2026 19:11

This branch was successfully deployed

No deployments
co/core / cocore-pr-263 — 5035ce84 Deployed Nov 30, 2026 by railway-app[bot]
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.

1 participant