Repository navigation
Record why a finished Audible backup could not match its title - #561
Merged
Merged
Conversation
Migration 0093 stores the refused fold's reason code and time on the Audible title, in the same transaction as the refusal, and clears them when a later import or accepted match succeeds. The admin API returns them and the console explains each reason from the stored code instead of reading it from the job; older titles keep their wording. bridge#47 (record a refused fold on the title).
importOwnBook returned a reason string beside a sentinel error, and the four stored codes were bare literals in the code and tests, so a typo compiled and showed the console's generic text. A foldRefusal now carries both (errors.Is still matches ErrImport*), the codes are AudibleFold* constants, and the fold decodes params and result itself so bridge.AudibleImportOf keeps its old contract. The clearing trigger also watches match_library_id and match_path, as audible_title_match_update does. Part of KodeStar/audiosilo-bridge#47.
The row looked the reason up inline with an i18next fallback array, so no list of the codes existed for a test to check. foldReasonKey maps the four codes (a newer one reads as other) and a test asserts each has English words, as the podcast codes do. Part of KodeStar/audiosilo-bridge#47.
The clearing trigger fired whenever a write named the match columns, and the poll upsert names them on every poll, so a refusal recorded on a title a poll had already matched (a backup that joined that book) was wiped by the next poll repeating the same match, or by a no-op undo of Not this book. The trigger now clears only when the match changes or rejected goes from 1 to 0, and a successful import clears the refusal in its own UPDATE, since it may land on the path already matched. Part of KodeStar/audiosilo-bridge#47.
The rejected_match sentence said the backup "found" the book, which left the admin guessing; it now says the backup went into that book and so was not matched, in all six languages. ReasonNote's doc comment is back on ReasonNote. Part of KodeStar/audiosilo-bridge#47.
A done Audible backup the server refused to match was logged as "recording a backup failed" although the refusal was stored on the title, sending an operator after a database fault that never happened. AudibleFoldRefusal reads the reason off the fold's error, and the log names it; a fold that could not run keeps the old message. Part of bridge#47.
A book's move or join rewrites the title's match_path, which the 0093 trigger reads as a newly accepted match, so renaming the folder of a book a backup was refused for (not_own_book) dropped the console's explanation although the title still has the same book and nothing new was accepted. moveAudibleTitles reads the moved titles' refusals first and puts them back in the same transaction. Part of bridge#47.
Deleting a library drops its matches and contests and cascades its jobs away, but a title whose backup into it was refused kept saying the server couldn't find the book in a library that no longer exists. DeleteLibrary clears the refusal on titles whose import job is that library's, in its own transaction, before the jobs go. Part of bridge#47.
A refusal stayed until a later import or match, so a newer backup that failed or was cancelled showed the older refusal beside its own status, and a newer done job whose fold never ran had its "Backed up" hidden by the older job's reason. SetAudibleImportTx now clears the refusal in the transaction that queues the job, so a stored refusal is always the title's current backup's and the console speaks only for the latest backup. Part of bridge#47.
KodeStar
added a commit
to KodeStar/audiosilo-docs
that referenced
this pull request
Nov 22, 2026
) Recaptures admin/audible-titles.png through screenshots/run.sh so the console's Audible titles list shows a title whose finished backup the server refused to match (KodeStar/audiosilo-server#561), beside ordinary rows. - The capture stages the refusal through the Audible fake and removes its staging book (with a rescan) when the step ends, so later shots in the same run (Back up everything: 16 queued, 1 skipped) are unchanged. - The manifest hint, caption and alt text describe the new image; the refusal sentence links to the section on unmatched backups. No PNG placed by hand; only this image changed.
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.
When a finished Audible backup can't be matched to its title, the server now stores why on the title, and the console explains it, instead of guessing from the job.
fold_refusal_reasonandfold_refused_aton the Audible title, written in the same transaction as the refused fold. Four reasons, each with plain console text in all six locales (it shows in place of "Backed up")./admin/audible/titles); the Bridge's report is unchanged, and the player wire is untouched.Part of KodeStar/audiosilo-bridge#47 ("Record a refused fold on the title"). Pairs with KodeStar/audiosilo-bridge (migration 0022, retried account removals) in the same cut.
Verified live with a Bridge built with the Audible fake, 12/12 console checks: each refusal sentence in en and the five other locales, kept across repeated polls and a folder rename, cleared when the next backup was queued; an upgrade of a data dir from 0092. Gate: build-admin, go build/vet/test -race/golangci-lint on the pure-Go and native SQLite engines.
Docs: KodeStar/audiosilo-docs (paired PR).