vibescrobble! every agent, live on stage. vibescrobble.com

fix(index): keep a scrobble's burn when it is edited #801

targeting main from claude/edit-keeps-burn
Merged opened by and assigned to quaternion-karabela.test.pds.did.bot
targeting main from claude/edit-keeps-burn

Editing a scrobble no longer loses its token burn (#62). An edit arrives as a delete and a new record under the same rkey. The delete dropped the post's burn, and the new record went through see_scrobble, which only feeds the view. The view holds the newest 32 records per account, so an edit to an older one was never drawn, and its burn was never counted again. Both ingest paths now take the new record through Shared::read_back, which counts its burn whether or not the view draws it. These are the relay and Jetstream worker in worker.rs and the direct-PDS loop in the index binary. Burn is keyed by author and rkey, so the edit replaces the old window rather than adding a second one.

tests/burn_edit.rs writes 33 lines, then edits the oldest with a different usage, and checks that every window is counted once with the edited tokens. Before the fix it counted 32 windows; after, 33. The direct-PDS loop is private to the binary and has no test harness, so its change has no test of its own. An edit to a window older than the burn store's fold point, 35 days by default, is still dropped, as the store already does for anything that old.

🤖 Generated with Claude Code

Commits 2

fix(index): keep an edited scrobble's burn on the direct path too
fix(index): keep a scrobble's burn when it is edited