Repository navigation
Merge FTS re-sync tags across import chunks - #990
Merged
Merged
Conversation
read -> query -> create_and_update -> link runs once per chunk of paths, but the search index syncs once afterwards. _bulk_update_models assigned each chunk's updated universes to FTS_UPDATED_M2MS, so a later chunk replaced an earlier one's and only the last chunk's universes had their comics re-indexed. Universes now accumulate like series summaries do, through one helper. 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.
Problem
The importer runs
read → query → create_and_update → linkonce per chunk of paths, then syncs the search index once at the end._bulk_update_modelsassigned each chunk's updated universes toFTS_UPDATED_M2MS["universes"], so a later chunk replaced the earlier chunk's set. When an import spanned more than one chunk (big libraries, memory-capped hosts), only the last chunk's universes had their comics re-indexed. Other comics kept the old designation in search.Fix
One helper,
_add_fts_updated_pks, now merges pks intoFTS_UPDATED_M2MSwithsetdefault().update(). Universes and the series-summary re-sync from #989 both use it.Test
tests/importer/test_fts_chunked_resync.py:The test fails on the old assignment (
'Alpha' != '11,Alpha') and passes with the fix.make fix,make lint,make tyare clean, and the fullmake testpasses (1735 Python, 1033 frontend).Found while testing, not fixed here
The inline importer path gives a universe's designation to only some comics' search rows:
pops a newly created universe's designation, so only the first comic linked to it in a batch gets it;FTS_CREATED_M2MSis also assigned per chunk.A full search-index rebuild corrects all of these.
🤖 Generated with Claude Code