Repository navigation
Conversation
Added migration to remove 6,816 duplicate plays (same CID, different rkeys) and a unique constraint on (did, cid) to prevent future duplicates. Updated feed_play ingestor to check for existing plays before inserting, gracefully skipping duplicates.
Previously rocketman::handler only advances the cursor when its Mutex<Option<u64>> is already Some(_); cadet initialised it from load_cursor() which returns None on a fresh start (or after a Garnet restart). The cursor then stayed None forever, the 60s store loop never fired, and every subsequent restart resumed jetstream from "live", silently dropping anything published during the disconnect window. Replace load_cursor() with resolve_startup_cursor() which falls back to the current wall-clock microseconds so the handler can keep advancing, clamps stored cursors older than the 12h replay window so we don't chase history jetstream no longer retains, and resets future-dated cursors. Mirror every store_cursor() write to the local file so the cursor survives Redis wipes, and bind cadet to a persistent named volume at /var/lib/cadet for the file mirror. Adds unit tests for the resume, fresh-start, and stale-cursor paths and serialises the cursor tests with a tokio Mutex so cargo's parallel runner can't race on the shared env vars.
- compose: stop publishing unauthenticated Garnet and Postgres on the host; map Satellite to the port it listens on (3001). - cadet: listen edits now store the new CID and the record's originUri; legacy alpha plays get the same durable retry as stable plays; CAR import dispatches reactions and fails visibly when any record fails. - satellite: drop its unlocked duplicate of Cadet's materialized-view refresh (the scheduler was never started anyway) and its unwrap/expect startup. - teal-cli: publicKeyMultibase carries the secp256k1 multicodec prefix. - release workflow: build the commit the requested tag points at, from the workspace root, and only for Dockerfiles that exist. - pre-commit hook no longer re-stages files that had unstaged hunks; setup-sqlx.sh runs migrations from the repo root.
They were unauthenticated, /api/car/fetch pulled up to 256 MB from any PDS per request, and both always failed to store the import. CAR imports go through Aqua's CLI and Cadet's Redis queue; /api/car/job-status remains.
…rator Any account can publish a playlistItem that points at someone else's playlist. Items and item counts are now filtered by playlist membership when read, so removed collaborators' items drop out too.
Android asked for a /app-return/<scheme> redirect that no published metadata allowed and no route handled, and the auth session waited on a hard-coded loopback URL. It now uses a native client document served by the web app at /android-client-metadata.json, redirecting to the origin's reversed-host scheme (as iOS does), registers that scheme in app.config.js, and returns the auth session on the same URI. The scheme rule lives in @teal/client.
- iOS: a token refresh that finishes after sign-out can no longer write its tokens back to the Keychain, and an auth-server outage or rate limit during refresh no longer signs the user out (only a refused grant does). - status: a failed Jetstream event is retried and then replayed from the last saved cursor instead of being skipped while later cursors are saved. - aqua: profile and handle backfills take Cadet's per-account lock and skip deactivated accounts, so a slow fetch can't recreate a purged profile.
- cadet: an existing MusicBrainz artist, release, or recording keeps its first indexed name; a later listen can only fill a missing discriminant. Before, renaming one listen's album relabelled that release for everyone. - client: renaming a track or release on a listen (single or bulk edit) now clears the MBIDs that no longer match, and unchanged artists keep their MBIDs instead of every edit stripping them. - cadet: refresh the stale play-ingestion DB test (canonical collection URI, full musicServiceUri) and have it cover the new CID and originUri writes. - Regenerate the SQLx offline cache; the removed entries were unused.
…s/ lockfile The edge is Caddy (compose.yaml) and the Cargo workspace and Cross.toml live at the repo root; nothing referenced these.
- cadet: an importRepo record can only queue an import of its own account. - cadet: fuzzy catalog consolidation (which repoints plays and deletes rows on similar names) only runs when CADET_CONSOLIDATION_INTERVAL_SECS is set. - cadet: identity events update known accounts instead of adding a profile row for every DID on the network; duplicate follow records no longer fail. - cadet: only the profile's self record can replace or delete it, and a DID-document handle is kept only when it resolves back to the DID. - cadet/aqua: private-address checks cover IPv4-mapped IPv6 and CGNAT; Aqua's CAR download uses the address-pinned client, and getRepoTopReleases runs at most two repo downloads at a time. - compose: Aqua and Satellite publish on loopback only.
- Listen links open only http(s) URLs on web and Android (safeHttpUrl in @teal/client); rich-text links use the same check. - DID document and handle lookups (which also run during web SSR) no longer follow redirects, time out after 8s, and refuse non-public did:web hosts. - aqua: getProfiles/getPlays decode their repeated query params (they rejected every request), cap them at 25, and getPlays returns the latest 100; /.well-known/did.json 404s instead of publishing a made-up key; main uses anyhow instead of Result<(), String>, unwrap, and expect. - iOS: Keychain writes update in place instead of delete-then-add. - web: other viewers reuse the listen page's server-loaded query; playlist edits refresh the owner's playlist list. - Manual listens are written in applyWrites batches of at most 200. - CI lints every TypeScript file with oxlint; `pnpm fix` runs oxlint --fix instead of an unrelated 'biome' npm package. - Remove dead files (teal-cli dev command, cadet/sql, duplicate target.sh) and correct the project layout in AGENTS.md.
- cadet: DID documents and CAR downloads go through one public-address, pinned-DNS, no-redirect, time-limited client (net.rs), closing the redirect and rebinding gaps Aqua's fix left in Cadet. - cadet: profile, status, profile-status, and social writes take the account lock and skip deactivated accounts, so a slow CAR import can't recreate purged data. - cadet: CAR imports fail when repo records can't be read, and skip profile records whose rkey isn't self, as live ingestion does. - cadet: every follow record is kept in social_follow_records (migration with backfill); deleting one leaves the follow while another record backs it. - Manual listens: a failure after some batches saved raises PartialSaveError; web and Android deselect the saved tracks, and iOS now batches the same way, so retrying doesn't log them twice.
- status: an event that can never be stored (a missing field, or Postgres rejecting its data, such as \u0000 in jsonb) is logged and skipped instead of being replayed forever and stopping every status update behind it. - cadet: a handle lookup that fails (outage, not yet indexed) keeps the stored handle instead of clearing it; the lookup has a timeout. Repeated importRepo records queue at most one import per account every 6 hours. - iOS: links open only for http(s) URLs, and renaming a track or release in the listen editor clears the MusicBrainz IDs it no longer matches, as web and Android do. - client: the identity-lookup timeout also covers reading the body, and a rich-text facet that ends before it starts is ignored. - The pre-commit hook and .pre-commit-config.yaml run oxlint instead of the removed Biome.
- cadet: social record deletes take the account lock, so deleting one backing record of a follow can't interleave with a concurrent write of another. - cadet: an importRepo claim lasts 60s and becomes the 6h cooldown only after the job is queued, so a dropped connection can't suppress imports with nothing queued (no Lua: Garnet runs scripts only with --lua). - Album logging on web, Android, and iOS: after a partial save, a retry starts the remaining tracks at the first unsaved track's time instead of rebuilding the timeline from the original start.
The datetime field holds local minutes, so restarting the remaining tracks from it dropped seconds, and during the repeated DST hour could move them an hour. Web and Android now keep the exact time while the form still shows it.
Deleting one backing record of a follow repoints the follow at another, but the cleanup also deleted the "followed you" notification and the re-insert didn't recreate it. The notification now moves with the follow.
Jetstream pings every 30s, and to_text() returns the ping payload, so the identity, account and commit checks logged a parse error on every ping.
Many listens exist in both play collections: a client scrobbled them live to fm.teal.alpha.feed.play and a later import wrote them again as fm.teal.feed.play records, a few minutes apart. Both were indexed, so the listen counted twice, and since alpha plays share the stable URI an alpha write or delete could also replace or remove a stable row. Plays now record their source collection. An alpha record never overwrites or deletes a stable row, an alpha play with a stable copy of the same track within 10 minutes is skipped, and a stable play removes an alpha copy already stored.
…mport pnpm backfill now runs tab (tangled.org/pds.dad/tab), which asks Lightrail for every repo with Teal plays, profiles or statuses in both the stable and alpha namespaces, fetches them from their PDSes, and follows live changes over Jetstream. The tab-backfill consumer acknowledges each event after storing it, so a rerun resumes, and spreads records over workers by DID so large repos don't serialize the whole backfill. The sequential lightrail-backfill binary and its scripts are removed.
Routing records to workers by DID put a large repo's whole backfill on one worker, so the backfill ran at about one query at a time. Tab already holds a repo's live events until its earlier events are acknowledged, and Cadet locks each account around play writes, so workers now share one queue. The consumer also runs as a release build with 16 workers.
…uses A play listing the same artist twice violated the artist-link primary key and failed on every attempt. Early alpha statuses wrote time and expiry as Unix-second strings, which failed to parse; they are converted to datetimes in both the live and CAR import paths.
Some alpha clients (retrievify) wrote artists as ["Name"] instead of
[{"artistName": "Name"}], so every such play failed to parse. Live
ingestion and CAR import now share one parse_play that repairs that shape
and the fractional durations the CAR path already handled.
A client wrote mbid:release-group:<uuid> into recordingMbId, which failed UUID parsing and dropped the whole play. MBIDs that are not bare UUIDs are now dropped during cleanup, like empty ones, and the play is stored.
piper's backfill wrote playedTime as 2026-04-03T18:56:16:00Z, which failed to parse and dropped the play. The extra trailing field is removed when the rest is an exact UTC time.
Some alpha clients wrote playedTime as Unix seconds or milliseconds in a string, which failed to parse and dropped the play. Those convert to UTC datetimes alongside the stray-field repair.
Some alpha plays store playedTime as a JSON integer of Unix seconds rather than a string; it converts like the string form.
Manual-entry clients wrote playedTime as a local time with no zone, at times without seconds. Those plays failed to parse and were dropped; they are now read as UTC, which keeps the listen at the cost of a possible offset of the listener's zone.
played_time comes from the record and was stored as given. The stats and listening windows only have a lower bound (played_time >= NOW() - interval), so a future-dated play stayed inside every recent window until its date passed. Cap it at the indexer clock plus five minutes of skew. Tested the cap in isolation against time 0.3.41. Full workspace not built locally (generated lexicon types need the pnpm toolchain). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AcLYwupyDZ6b9ThgjwKUb3
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is all of teal's open work in one PR again. The stacked split (#194–#243) made review harder rather than easier, so everything is folded back into
obbpr. It's a fast-forward: no commits were rewritten. 183 commits, ~600 files.What's in it
fm.teal.*namespaces validated as AT Protocol lexicons.getToday,getReactions,getTasteMatch,getListeningCalendar, plus listening context on posts.5.0.0-rc.1) and Tailwind 4, TanStack Query,PRODUCT.mdandDESIGN.md.components/ds/: page shell, glass panels, text, buttons, choices, fields, tabs, notices, and dialog.lib/modules (top stats, compose, playlists, music, cross-posting, profile records).lib/and the auth store were ported unchanged./manual-listensredirects to it. Posts show reactions in place of like and repost buttons.7b51f60(rebuild),18a368a(swap), then council fixes through41a11e4.Verification
cargo test -p aqua -p cadetpasses, including the ignored database test for the new endpoints run against local Postgres.pnpm lex:validatepasses.pnpm typecheckpasses.pnpm --filter=@teal/amethyst build:webexports.Not verified
package.json. Pruning them is a follow-up.cargo clippy -D warningsfails on 30async_traiterrors thatmain's toolchain already reports. None are in new code.Web QA
A three-model council reviewed the web app at 1440, 1024 and 390 wide, in light and dark. The fixes are in commits
a0705edthroughe49cc84:fm.teal.alpha.feed.social.postcollection in their URI, and now route correctly.Follow-ups:
did/rkeyin the URL. This predates the redesign.Coverhas.Earlier council review (app rewrite)
Rewrite rounds: 4. Sol's round 3 didn't run because Codex hit a usage limit, so its round 4 covered everything since round 2.
Earlier web QA of the redesign, before the rewrite (5 rounds):
Codebase review and fixes (
a8b6ddd..1d2d22a)A whole-repo review and fix pass, 24 commits:
importReporecords only import the publisher's own repo, at most once per 6 hours.originUri.social_follow_records(new migration, backfilled)./android-client-metadata.json).pnpm lintpasses repo-wide and runs in CI.@teal/client.CADET_CONSOLIDATION_INTERVAL_SECSis set.Verified for this pass: workspace clippy with
-D warnings;cargo testfor aqua, cadet and status-api, including the ignored DB tests against local Postgres; client tests (367 passed);pnpm typecheck;pnpm lint; the web build; the iOS simulator build. Android sign-in on a device is still unverified (intodo.md), as are the deferred performance items listed there.Council review
Codebase review, rounds: 5. Opus's round 3 hit the Claude usage limit, so its round 4 covered everything since round 2.