Skip to content

Label db sync failures by real cause - #213

Merged
rowkav09 merged 1 commit into
mainfrom
fix/db-sync-failure-label
Oct 2, 2026
Merged

rowkav09 merged 1 commit into
mainfrom
fix/db-sync-failure-label

Conversation

@rowkav09

@rowkav09 rowkav09 commented Oct 2, 2026

Copy link
Copy Markdown
Member

Fixes #212. Mirrors the #211 worker fix in the db classifier: SyntaxError is upstream_response, and 'token' only means authentication when Plex is named. Fail-first tests in sync-failure-label.test.ts.

@rowkav09

rowkav09 commented Oct 2, 2026

Copy link
Copy Markdown
Member Author

Reviewed head 18568b8 (on main a95344f). Approved.

Worker, plex and db suites pass (161/161, 29 files). Two of the three new tests fail against main's repository.ts. The third, the Plex token case, passes on main as well, so it only guards against regressions. I ran 15 error shapes through failSyncRun on main and on this head. These are the changes:

  • SyntaxError, including a real JSON.parse failure, goes from authentication to upstream_response.
  • token expired, invalid token, a uuid error mentioning a token, and a TypeError mentioning a token go from authentication to unknown.

These are unchanged and still authentication: Plex token invalid, bad X-Plex-Token, PLEX rejected the Token, plex token request timeout and bad credentials. An error that carries its own classification still wins, even a SyntaxError.

Two things to be aware of, neither blocking:

  • A SyntaxError from anywhere in the sync, such as a bad config parse, now shows "Plex returned an unexpected response".
  • A Plex error that says only "token" and never "plex" now shows as unknown instead of authentication. That is the trade-off you chose.

CI at the time I checked: TypeScript workspace, Compose config and CodeFactor green. The four container builds were still running, so it is not CI-green yet.

@codecov

codecov Bot commented Oct 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
packages/db/src/repository.ts 50.00% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@rowkav09
rowkav09 merged commit ac48ed1 into main Oct 2, 2026
9 checks passed
@rowkav09
rowkav09 deleted the fix/db-sync-failure-label branch October 2, 2026 10:34
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.

The db copy of the sync failure classifier still mislabels SyntaxError and bare 'token' messages

1 participant