Repository navigation
fix: stop telling users Spotify is broken when a link is just not public - #556
Merged
Merged
Conversation
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)
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.
A user linked their Spotify daylist. The bot answered:
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
trackListof zero entries too, and production's sleevenote returned the same failure — it was never about one deployment.The bot's message is what turned a private link into a reported outage, and it cost an evening to establish it wasn't one.
Where it went wrong
sleevenote answered
extraction_empty, and this crate maps that arm toSPOTIFY_LOOKUP_BROKEN— correctly, for what that code used to mean. The code carried two different facts.cycle-five/sleevenote#15 splits them:
extraction_emptynow means only that Spotify declared items extraction recognised none of (our bug), and the newlisting_emptymeans the listing is real and has nothing in it we can see (not our bug). This PR takes the new code.ErrorCode::ListingEmpty/Error::ListingEmptyUnrecognizedSPOTIFY_LISTING_EMPTYThe new message:
That last sentence is measured, on the reporter's own daylist: the personalised link yields zero tracks, the
?si=share form resolves 50 of 50.Worth noting:
SPOTIFY_NOT_FOUNDalready described this case — "private or personalized — a playlist Spotify generates for you, like your daylist" — but it hangs offnot_found, which a daylist never returns. The right words were already written and simply unreachable.🪤 The compiler cannot help here
user_messageends in a catch-allotherarm, so a new client variant compiles clean and silently reportsSPOTIFY_LOOKUP_FAILED. Only a test can catch that, so two tests pin both halves — the invisible listing must not say "broken", and a genuine extraction break still must.Both were sabotaged and watched fail:
SPOTIFY_LOOKUP_BROKENan_invisible_listing_does_not_claim_the_lookup_is_brokenFAILEDPlus a client-crate test that
listing_emptyis a distinct variant and neverUnrecognized.Gate
cargo fmt --all --checkclean ·cargo clippy --workspace --all-targets0 warnings ·cargo test --workspace557 passed / 0 failed (up 3).Two notes for the reviewer
[workspace.package].ErrorCodeis not#[non_exhaustive]whileErroris, so adding a code is technically a breaking change for an external consumer.crack-sleevenoteis not on crates.io yet, so nothing is broken today — but the enum's whole design is forward compatibility (that's whatUnrecognizedis for), and marking it would make this the last time adding a code could break anyone. Not done here; it's a separate, deliberate break.Separately still unmapped: sleevenote's
overloadedandbrowser_unavailable(its 0.5.0 503s) fall through the same catch-all to "Spotify lookup failed", logged at ERROR. Same function, same shape of fix — say the word.🤖 Generated with Claude Code
https://claude.ai/code/session_01F8PrF3gizKqXCStjCuWL3d