Repository navigation
fix: an empty listing is not a broken extraction - #15
Merged
Merged
Conversation
A Spotify "daylist" (37i9dQZF1EP6YuccBxUcC1) answered 502 `extraction_empty`, whose message reads "extraction likely stopped matching Spotify's page". cracktunes relays that arm as "⚠️ Spotify lookup is broken right now", so an id nobody can read signed-out was reported as an outage of the whole integration -- and cost an evening establishing it was not one. Nothing was broken. Spotify's own oEmbed serves that id a `trackList` of zero entries too; the playlist's contents exist only for its signed-in owner. Production's sleevenote returns the same 502 for it, so it was never about this deployment either. The two cases were always distinguishable and the code already had the figure that separates them. Reaching the zero-track branch proves extraction still matches the ENTITY -- `normalizeByKind` returns null otherwise, which throws ExtractionSilentError well before here -- so the only question left is whether the ITEMS are missing or absent. Spotify's declared total answers it, being the one number there that speaks for the page and not for us: - declared > 0 and we parsed none -> ExtractionEmptyError, unchanged in meaning but now only ever this, with the count in the message. - declared 0 or none at all -> ListingEmptyError, new: there was nothing to extract. `listing_empty` keeps 502 so no caller's status handling changes -- the code carries the distinction -- and is never negative-cached, because a listing empty today can have items tomorrow. It also stops tripping the redesign canary. `extraction_empty` exists to make a Spotify redesign loud; counting every personalised playlist as one is how that alarm stops meaning anything. Tests: both zero-track shapes through extract(), the route's code, and the canary staying put. Each was sabotaged and watched fail -- collapsing the split, letting the empty listing call extractionEmpty.inc(), and reporting the old code. Gate: npx tsc --noEmit clean, npm test 217 passed / 9 skipped. Co-Authored-By: Claude & Lothrop (cycle.five@proton.me)
cycle-five
added a commit
to cycle-five/cracktunes
that referenced
this pull request
Sep 22, 2026
…lic (#556) * fix: stop telling users Spotify is broken when a link is just not public A user linked their Spotify daylist. The bot answered "⚠️ Spotify lookup is broken right now. This has been logged." Nothing was broken: a daylist's contents exist only for its signed-in owner, so a signed-out scraper sees an empty listing. Spotify's own oEmbed serves that id a trackList of zero entries too. sleevenote answered `extraction_empty` for it, and this crate maps that arm to SPOTIFY_LOOKUP_BROKEN -- correctly, for what that code used to mean. sleevenote 0.6.0 splits the code in two (cycle-five/sleevenote#15): `extraction_empty` now means only that Spotify declared items extraction recognised none of, and the new `listing_empty` means the listing is real and has nothing in it we can see. This side takes the new code: - `ErrorCode::ListingEmpty` / `Error::ListingEmpty`, round-tripping like every other documented code rather than landing in Unrecognized. - SPOTIFY_LISTING_EMPTY, which offers no retry -- retrying the same link cannot work -- and names the thing that does: the share link. Measured, on the reporter's own daylist: the personalised link yields zero tracks, the `?si=` share form resolves 50 of 50. SPOTIFY_NOT_FOUND already described this case ("private or personalized -- a playlist Spotify generates for you, like your daylist"), but it hangs off `not_found`, which a daylist never returns. The right words were already written and simply unreachable. 🪤 user_message ends in a catch-all `other` arm, so a new client variant compiles clean and silently reports SPOTIFY_LOOKUP_FAILED. Nothing but a test can catch that, so the two new tests pin both halves: the invisible listing must not say "broken", and a genuine extraction break still must. Both were sabotaged -- re-pointing the arm at the old message, and deleting the arm so it falls through -- and watched fail. Gate: cargo fmt --check clean, clippy 0 warnings, 557 passed / 0 failed. Co-Authored-By: Claude & Lothrop (cycle.five@proton.me) * chore: release as 0.14.0, not 0.13.2 The tag that ships the daylist message fix also carries the 2026-09-21 dependency batch, which is a sqlx major (0.8.6 -> 0.9.0), and this branch adds a variant to `ErrorCode`, which is not `#[non_exhaustive]`. Either one argues for the minor position; a patch would read as neither having happened. Owner's call, taken 2026-09-22. Co-Authored-By: Claude & Lothrop (cycle.five@proton.me)
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.
What happened
A Spotify daylist (⚠️ Spotify lookup is broken right now", so the bot announced an outage of the whole integration for one unreadable id — and an evening went into establishing that nothing was wrong.
37i9dQZF1EP6YuccBxUcC1) answered 502extraction_empty, whose message says "extraction likely stopped matching Spotify's page". cracktunes maps that arm to "Nothing was. Evidence:
trackListof 0 entries, while Today's Top Hits returns a populated one. That is Spotify's answer with sleevenote nowhere in the picture — the playlist's contents exist only for its signed-in owner.37i9dQZF1FbGxhQBHxnJF4, the?si=form) resolves fine: 50/50 tracks, complete.The fix
The two zero-track cases were always distinguishable, and the code already had the figure that separates them.
Reaching the zero-track branch already proves extraction still matches the entity —
normalizeByKindreturnsnullotherwise, and that throwsExtractionSilentErrorwell before here. So "extraction likely stopped matching" was wrong by construction on that line. The only open question is whether the items are missing or absent, and Spotify's declared total answers it, being the one number there that speaks for the page rather than for our parser.> 0extraction_empty(unchanged)0ornulllisting_empty(new)listing_emptykeeps 502 so no caller's status handling changes — the code string carries the distinction — and is never negative-cached, because a listing empty today can have items tomorrow.It also stops tripping the redesign canary.
extraction_emptyexists to make a Spotify redesign loud; counting every personalised playlist as one is how that alarm stops meaning anything.listing_emptyis counted inscrape_failuresand deliberately not insleevenote_extraction_empty_total.Tests
Four, covering both shapes through
extract(), the route's code, and the canary staying put. Each was sabotaged and watched fail:if (true))expected ExtractionEmptyError … to be an instance of ListingEmptyErrorextractionEmpty.inc()expected 1 to be +0expected 'extraction_empty' to be 'listing_empty'Gate:
npx tsc --noEmitclean,npm test217 passed / 9 skipped.Follow-up
cracktunes needs the matching arm so the user hears something true; that PR cites this one. Until it merges,
crack-sleevenoteseeslisting_emptyasErrorCode::Unrecognized— which is still an improvement on being told the integration is down.🤖 Generated with Claude Code
https://claude.ai/code/session_01F8PrF3gizKqXCStjCuWL3d