Skip to content

fix: stop telling users Spotify is broken when a link is just not public - #556

Merged
cycle-five merged 2 commits into
masterfrom
fix/spotify-empty-listing-message
Sep 22, 2026
Merged

cycle-five merged 2 commits into
masterfrom
fix/spotify-empty-listing-message

Conversation

@cycle-five

Copy link
Copy Markdown
Owner

A user linked their Spotify daylist. The bot answered:

⚠️ Spotify lookup is broken right now.
This has been logged. Search for the track by name and I'll play it.

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, 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 to SPOTIFY_LOOKUP_BROKEN — correctly, for what that code used to mean. The code carried two different facts.

cycle-five/sleevenote#15 splits them: extraction_empty now means only that Spotify declared items extraction recognised none of (our bug), and the new listing_empty means the listing is real and has nothing in it we can see (not our bug). This PR takes the new code.

ErrorCode::ListingEmpty / Error::ListingEmpty round-trips like every other documented code, instead of landing in Unrecognized
SPOTIFY_LISTING_EMPTY offers no retry — retrying the same link cannot work — and names the thing that does

The new message:

⚠️ That link looks empty from here.
Spotify only shows its contents to you — personalized lists like your daylist look empty to anyone else, including me. Open it on Spotify, tap share, and paste that link: it usually works.

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_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.

🪤 The compiler cannot help here

user_message ends in a catch-all other arm, so a new client variant compiles clean and silently reports SPOTIFY_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:

sabotage result
re-point the new arm at SPOTIFY_LOOKUP_BROKEN an_invisible_listing_does_not_claim_the_lookup_is_broken FAILED
delete the arm so it falls through the catch-all FAILED (no compile error — which is the point)

Plus a client-crate test that listing_empty is a distinct variant and never Unrecognized.

Gate

cargo fmt --all --check clean · cargo clippy --workspace --all-targets 0 warnings · cargo test --workspace 557 passed / 0 failed (up 3).

Two notes for the reviewer

  1. Version is bumped to 0.13.2 (patch, a bug fix). The tag that ships this will also carry the 2026-09-21 dependency batch — sqlx 0.9 — which is still unreleased on master. If you'd rather that read as a minor, it's the one line in [workspace.package].
  2. ErrorCode is not #[non_exhaustive] while Error is, so adding a code is technically a breaking change for an external consumer. crack-sleevenote is not on crates.io yet, so nothing is broken today — but the enum's whole design is forward compatibility (that's what Unrecognized is 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 overloaded and browser_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

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)
@cycle-five
cycle-five merged commit 24bc1dc into master Sep 22, 2026
12 checks passed
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