Skip to content

Add Missing Pack Fields - #84

Merged
283375 merged 2 commits into
masterfrom
refactor/pack-20261102
Nov 1, 2026
Merged

283375 merged 2 commits into
masterfrom
refactor/pack-20261102

Conversation

@283375

@283375 283375 commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator
  • Add missing basic Pack fields
  • Add tests for packlist importer

@283375

283375 commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator Author

/opencode Review this PR. Avoid external directory access (/home, /tmp, etc.) as it will block unattended session with permission requests.

@opencode-agent

opencode-agent Bot commented Nov 1, 2026

Copy link
Copy Markdown

Review

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.

github run

@283375
283375 merged commit a985434 into master Nov 1, 2026
4 checks passed
@283375
283375 deleted the refactor/pack-20261102 branch November 1, 2026 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant