Repository navigation
Index universe designations on every imported comic - #991
Merged
Merged
Conversation
The importer's inline search writer took designations only from a map of universes created in this import. It popped each entry, so only the first comic linked to a new universe got it; it keyed the map on a comic's whole tuple of universe names, so a comic with two universes got none; it never covered existing or kept universes; and it was replaced per chunk. Look the designations up instead, one batched Universe query per search pass over every universe name the pass indexes, new, existing or kept, and drop the created-universes map. 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
A full search rebuild (
SearchIndexerSync) indexes each universe as its designation plus its name, e.g.1,Alpha. The importer's inline writer took designations only fromFTS_CREATED_M2MS, a map of universes created in the current import. That map was wrong in several ways, so a search for a designation missed many imported comics until the next full rebuild:popped, so only the first comic linked to a new universe got the designation.Fix
At search-entry time,
importer/search/update.pycollects every universe name the pass indexes: new links plus kept links fromFTS_EXISTING_M2MS. It looks them all up in one batchedUniversequery (nameis unique) and adds the matching designations to each entry. That makes the inline path match what the full rebuild writes.FTS_CREATED_M2MSand the code that filled it are removed.The FK re-sync for a universe whose designation changes (
FTS_UPDATED_M2MS, fixed for chunking in #990) is unchanged.Tests
tests/importer/test_universe_fts_designations.pycovers a new universe shared by two comics, two universes on one comic, a link to an existing universe, a kept universe after adding another, and a later chunk with the chunk size forced to 1. All five fail before the fix and pass after.test_basic,test_update_allandtest_update_noneno longer expectFTS_CREATED_M2MS. The link-stage snapshot now holds only universe names, and the final stored row still reads4242,Young Adult Silly Universe.make fix,make lint,make tyare clean, and the fullmake testpasses (1740 Python, 1033 frontend). The NEWS line from #990 is folded into one.🤖 Generated with Claude Code