bugfix #1925: stop library scans from silently dropping titles - #1926
Merged
Conversation
Audible's catalog endpoint can answer 200 while omitting products from the response. getProductsAsync returned whatever came back, so any podcast episode Audible skipped simply vanished from the scan. The reporter's log shows this: across 1117 consecutive scans of an unchanged 440-item library, the post-scan item total drifted between 2147 and 2151. Re-request the omitted asins before accepting the loss, and warn with the asins that are still unaccounted for afterwards. The rest of the scan's exclusions were equally invisible at the default log level, which is why the reporter found nothing in the log about the missing book: - episodes dropped for having no series parent were logged at Debug, without identifying them. Warn instead, and name them. - titles excluded by ImportEpisodes / ImportPlusTitles were not logged at all. Tally them, and record both settings in the startup state block. Read the two import filters once per scan so a settings change mid-scan can't produce a half-filtered library. Co-authored-by: rmcrackan <rmcrackan@gmail.com>
Extract the link-then-prune step out of getItemsAsync so the behavior that removes a podcast episode from a scan can be exercised directly, and pin it down with tests, including the season-container case where an episode's parent is not something Libation treats as a series parent. Co-authored-by: rmcrackan <rmcrackan@gmail.com>
Co-authored-by: rmcrackan <rmcrackan@gmail.com>
Co-authored-by: rmcrackan <rmcrackan@gmail.com>
Co-authored-by: rmcrackan <rmcrackan@gmail.com>
Co-authored-by: rmcrackan <rmcrackan@gmail.com>
ConfigureFrom always calls ResolveSecretStore, which falls through to OsSecretStore.Create(...).IsAvailable when no master key file or env var is present. That is a blocking libsecret call: on a headless machine, or one whose login keyring is locked, it waits on a desktop unlock prompt that never gets answered. Five tests reached it and one reached it twice, so the project took 12+ minutes instead of seconds. Probing availability first does not help, because the probe is the blocking call. Tests that only assert which write method gets configured now resolve the master key from a temp key file, so they short-circuit before the OS store. This also stops them minting a last-resort key into the real Libation folder. The two tests that exist to exercise the real OS store are opt-in via LIBATION_TEST_OS_SECRET_STORE=1. AudibleUtilities.Tests: 12m 20s -> 1.8s, 72 passed / 2 skipped / 0 failed. Co-authored-by: rmcrackan <rmcrackan@gmail.com>
Co-authored-by: rmcrackan <rmcrackan@gmail.com>
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.
Diagnoses and addresses #1925, where a title visible on Audible did not appear in Libation and left no useful trace in the log. Also fixes an unrelated test-suite bottleneck found while working on it.
Diagnosis
The attached log contains 1140 scans. The direct library page count is stable, but podcast expansion is not:
1117 consecutive scans read exactly 440 direct library items but produced five different expanded totals. Audible's catalog endpoint can return HTTP 200 while omitting requested products. Libation accepted that partial response, then silently removed episodes that could not be linked to a series parent. Separately, an episode already in the database whose parent was absent rendered nowhere, because neither grid treated it as a product or as a displayable series child.
The log could not explain other exclusions either: orphan pruning was Debug-only and did not name titles, and
ImportEpisodes/ImportPlusTitleswere not logged at all.Scan changes
ImportEpisodes,ImportPlusTitles, andDownloadEpisodesin the startup state block.Grid changes
How this addresses #1925
Three protections at the points where the reported title could vanish:
A non-episode title omitted from Audible's direct paged library response still cannot be recovered, since Libation never receives an ASIN for it. The new tally makes that API-side discrepancy visible and distinguishes it from local filtering.
Test suite bottleneck (unrelated to #1925, found while testing)
IdentityTokenStorageWiring.ConfigureFromalways callsResolveSecretStore, which falls through toOsSecretStore.Create(...).IsAvailablewhen no master key file or env var is set. That is a blocking libsecret call. On a headless machine, or one whose login keyring is locked, it waits on a desktop unlock prompt that never gets answered. Five tests reached it and one reached it twice. Guarding with an availability probe does not help, because the probe is the blocking call.LIBATION_TEST_OS_SECRET_STORE=1.AudibleUtilities.Testswent from 12m 20s to 1.8s. The test that used to fail in this environment is now a clean skip.Verification
Avalonia and CLI builds pass with 0 errors. All Linux-buildable test projects, each under a hard timeout:
LibationUiBaseincludes direct verification that an orphaned episode becomes a standaloneLibraryBookEntry. Zero failures anywhere; the whole suite now runs in about 6 seconds.