Repository navigation
fix: keep volumes of one series apart in dedup and the works table - #614
Merged
Merged
Conversation
Series volumes that share a title, narrator and runtime (translated light novels) were merged into one book, and the merge was persisted, so the later volumes vanished from the series page and showed as In Library. - Series page rows carry their position label (modern series-header, legacy h2 when the title came from the h3) and the series ASIN; a catalog batch call fills missing positions only when a merge is proposed (24 h cache, 15 min pause after a transient failure). - Local dedup and the works-table collapse never merge known different volumes; only groups with settled positions are persisted. - A persisted merge never absorbs a work holding ASINs outside the group; creates skip concurrent inserts and only empty works are deleted. - Existing wrong links heal on the series, search and author views and in watched series and author syncs, before the owned check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Cache fallback positions per region, series and ASIN, so a book in two series keeps both positions; a non-transient catalog error is cached as unknown instead of repeating on every view. - Also fill unlabelled rows that a saved work links to another row on the page, from the heal's own work lookup (no extra query); the heal now takes the series ASIN and returns the filled rows. - Search and author rows read the catalog sequence through normalizePosition, so a range stays unknown there too. - The heal skips a work whose canonical ASIN is not in view, picks the canonical the same way as the collapse (shared canonicalByWork), and names a new work after its class anchor. - The second watched author list heals only after the first list's groups are written. - A legacy h2 never supplies the title used to read a position; the routes drop the dead catch on the heal, which never throws. Refs #599 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The series scrape logs "Failed to scrape series detail <asin>" and then the
error ("status code 503") as JSON on the following lines, so the
same-line pattern never matched and a live 503 on one of the concurrent
reads failed the spec instead of skipping it. Look up to three lines on.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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.
What changed
series-headerattribute; legacy pages read theh2only when it is label-shaped and the title came from anh3/.bc-headingoutside thath2. Positions are stored normalized ("1", "1.5"; ranges count as unknown). Search and author rows read the catalog sequence the same way, so a range such as "1-3" is unknown there too.response_groups=series, one call per 50 such rows, each with a 3 s deadline and no retry. Results are cached 24 h per region, series and ASIN (a book in two series keeps both positions); a non-transient error such as a 400 is cached as unknown; a 429, 5xx or timeout pauses these calls for 15 min (separately from the details fill pause). A failure leaves the position unknown.createMany({ skipDuplicates: true }), and one failing group no longer stops the rest.dedup_autorows move; a rerun or a concurrent view changes nothing. In a watched author sync the second list heals only after the first list's groups are written. The heal never throws, so it never fails the page.integrations/audible.md(layout table, position fallback, veto levels, heal, merge rule, the five call sites, Fixed Issues),features/watched-lists.md,testing/e2e-harness.md.Why
FallenLeave91 reported in #599 that vols 2 and 3 of a German light-novel series were missing from the series view, while vol 1 was available and vols 4 and 5 were requested. They proposed using the series ASIN plus the position as the guard and cleaning up the saved links; this PR does both. The diagnosis: the volumes share a title, narrator and runtime, local dedup never read series positions, the series page parser dropped the position label, and every multi-ASIN group was saved and merged every work it touched. One false merge therefore stuck, and it also leaked through the sibling lookup, so vols 2 and 3 could count as already owned for availability, request dedup and the watched owned check. Thanks to FallenLeave91 for the clear report and the proposal.
Checks
npx vitest relatedon the changed sources: 190 files, 2444 passed.npm run test: 647 files, 11905 passed, 9 skipped, 0 failed.npx tsc --noEmitclean; ESLint: no problems on new or changed lines (the remainingno-explicit-anyhits are on untouched lines of older test files).599-series-volumes(live audible.de series B0H3C5X19W, region de, a seeded 1.3.0-style work linking vols 1-3, vol 1 in the library). On the first commit: 3 passed. The five issue ASINs listed once each, vol 1 available, vols 2 and 3 not; the database holds vols 1-3 in three works with no empty work; five concurrent views all return 200 with the same end state. Shots at 1280 light and 375 dark.smoke1 passed; upgrade from 1.3.0 (upgrade.spec.ts) seed and verify 2 passed, row counts unchanged.Screenshots
Series page on the final commit, from the test stack (covers are stand-in tiles). Volumes 1 to 5 are separate cards; volume 1 is in the library.
Risk and rollback
Closes #599
🤖 Generated with Claude Code