You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Solid refactor overall: the schema diff is clean (only the packs table gains columns), the importer maps the real packlist fields correctly, and :shared:jvmTest passes. One behavioural regression needs addressing.
1. Existing databases lose append-pack grouping after the migration — medium
AutoMigration(from = 16, to = 17) only adds columns; it doesn't populate them. But append detection moved from an id regex to the stored parentPackId:
Pack.isAppendPack now returns parentPackId != null (shared/.../entities/Pack.kt:17)
ArcaeaCatalog.basePacks / appendPacksByBasePackId use parentPackId (shared/.../search/ArcaeaCatalog.kt:54, :59)
Packs are only written by a user-triggered packlist import (DatabaseManageViewModel.importPacklistTask), not on startup. So a user upgrading with an existing DB keeps parent_pack_id = NULL for every row until they re-import. Result: append packs are silently treated as base packs — ArcaeaPackSelector no longer nests them (app/.../ArcaeaPackSelector.kt:34) and the catalog exposes them as filter entries. This is a silent regression versus the old regex behaviour.
Options:
Add a Migration_16_17 that backfills parent_pack_id from the legacy id pattern (eden_append_1 → eden); this preserves the old behaviour for all packs the old code recognised. New imports then fill in the rest (epilogue → finale, which the old regex missed).
Or keep a legacy fallback in Pack.isAppendPack / catalog until a re-import happens, and document the required re-import.
2. No 16→17 migration test — low
DatabaseMigrationsTest has coverage for the other migrations (14→15, 15→16). Since this version adds a NOT NULL column with a default, add a test that migrates from 16 and asserts existing rows keep their data with is_extend_pack = 0. If you implement the backfill above, assert parent_pack_id is populated as well. ArcaeaOfflineDatabase.kt:70 is where the migration is registered.
3. Minor test gaps — nit
ArcaeaPacklistImporterTest verifies the -1 sentinel and explicit pack_parent, but doesn't assert that an omitted plus_character maps to null (the extend_x case) or that isExtendPack defaults to false for an append pack. Small additions that would lock in the mapping.
The plus_character == -1 → null handling matches the published packlist data, and the built-in single/Memory Archive pack is correctly absent from the real packlist, so those parts look right.
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
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.
Packfields