chore: remove dead protocol remnant (schema v11), dep bumps, local gate#116
Conversation
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
Comment |
| AutoMigration(from = 7, to = 8), | ||
| AutoMigration(from = 8, to = 9), | ||
| AutoMigration(from = 9, to = 10), | ||
| AutoMigration(from = 10, to = 11, spec = SagerDatabase.RemoveNekoColumn::class), |
There was a problem hiding this comment.
Missing Room schema JSON for v11
app/schemas/io.nekohasekai.sagernet.database.SagerDatabase/11.json is absent from this commit. Room's KSP processor generates it on the first compile, but without it being committed:
MigrationTestHelper.createDatabase(TEST_DB, 11)in any future instrumented test cannot locate the schema and will throwFileNotFoundException- Any subsequent auto-migration (v11 → v12) will fail at compile time because Room needs the prior-version schema to validate the
fromside
The PR description acknowledges this and calls it out as "must resolve before merge." Confirming here so it is tracked as an explicit blocker — the generated file from the first CI compile must be added to the commit before this lands.
| @@ -0,0 +1,24 @@ | |||
| #!/usr/bin/env bash | |||
There was a problem hiding this comment.
Script committed without executable permission
Both scripts/verify.sh and scripts/hooks/pre-push are committed with mode 100644 instead of 100755. On any fresh clone, ./scripts/verify.sh and the symlinked pre-push hook will fail immediately with "Permission denied" — git cannot exec a non-executable file. Fix: git update-index --chmod=+x scripts/verify.sh scripts/hooks/pre-push.
cdfdb76 to
b561ec5
Compare
6f0e750 to
2c51c87
Compare
b561ec5 to
846f0f8
Compare
2c51c87 to
bd69a7a
Compare
846f0f8 to
7d97488
Compare
bd69a7a to
467b686
Compare
7d97488 to
d225538
Compare
eed97fa to
9da095a
Compare
9da095a to
1d64f3c
Compare
Summary
Dead-code removal (with an additive, non-destructive schema migration), dependency
bumps, and local developer-experience improvements. Stacked on the performance +
security PR (merge that first).
Changes
bean and all its dead branches. Its stored column is dropped via an additive
@DeleteColumnauto-migration (schema v11); non-functional legacy rows of thattype are purged in the migration. The numeric type id stays reserved so it is never
reused. Existing stored data is otherwise untouched.
releases; the test SDK pins are raised toward the app’s target (the newer test
framework bundles it).
so the local format gate no longer needs a workaround flag.
compile + unit tests, no artifact assembly) and a sample opt-in pre-push hook.
Schema note (must resolve before merge)
The Room schema JSON for v11 is generated by the annotation processor at compile
time. Because this environment does not run a local build,
.../SagerDatabase/11.jsonis not in the commit yet. It must be taken from the first CI compile and committed
(it must equal the v10 schema minus the dropped column). The prior schema files are
left untouched. The generated identity hash must come from the processor, not be
hand-written.
Testing
test run in CI.
(existing stored data survives; the app opens cleanly) before merge.
Held for a follow-up (device session, not in this PR)
stats, and a couple of on-device verifications were intentionally deferred: their
acceptance requires on-device / full-build verification that isn’t available here.
Greptile Summary
This PR removes the vestigial Matsuri "Neko Plugin" protocol: deletes
NekoBean.java, strips everyTYPE_NEKOcode path fromProxyEntity,KryoConverters,TypeMap,ConfigurationFragment, andProtocols, and drops thenekoBeancolumn fromproxy_entitiesvia a Room v11 auto-migration that also purges any lingering type=999 rows. Dependency bumps (kotlinx-coroutines 1.11.0, Robolectric 4.16.1, Spotless 7.0.4) and a newscripts/verify.shlocal gate round out the change.@DeleteColumnonproxy_entities.nekoBeanis paired with anonPostMigratedelete of all rows withtype = 999. The schema JSON for v11 is now committed and theidentityHashis present, resolving the previously flagged blocker. The migration path is additive and non-destructive to all other existing data.nekoBean != nullorTYPE_NEKOare cleanly removed across six files;TYPE_NEKO = 999is kept as a reserved constant with a clear comment to prevent id reuse.scripts/verify.sh(format → compile → unit tests, no APK assembly) and a sample opt-in pre-push hook are added with mode100755, addressing the previous permission issue.Confidence Score: 5/5
Safe to merge after CI confirms the Room KSP build passes with the committed 11.json hash.
The dead-code removal is thorough and consistent across all six affected files. The migration is additive — it only drops an unused column and purges non-functional rows; existing user data for all real protocols is untouched. Both previously flagged blockers (missing schema JSON, non-executable scripts) have been addressed in follow-up commits.
SagerDatabase.kt and 11.json — the migration spec and schema file are the two places where a silent error (wrong identity hash or skipped onPostMigrate) would only surface at runtime on a device upgrade.
Important Files Changed
Sequence Diagram
%%{init: {'theme': 'neutral'}}%% sequenceDiagram participant App participant Room participant RemoveNekoColumn participant SQLite App->>Room: open database (v10 DB detected) Room->>Room: "apply AutoMigration(from=10, to=11)" Note over Room: @DeleteColumn drops nekoBean<br/>via table-copy strategy Room->>SQLite: CREATE new proxy_entities (without nekoBean) Room->>SQLite: INSERT INTO new SELECT ... FROM old Room->>SQLite: DROP TABLE old Room->>RemoveNekoColumn: onPostMigrate(db) RemoveNekoColumn->>SQLite: "DELETE FROM proxy_entities WHERE type = 999" RemoveNekoColumn-->>Room: done Room->>SQLite: UPDATE room_master_table SET identity_hash Room-->>App: database ready (v11)%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% sequenceDiagram participant App participant Room participant RemoveNekoColumn participant SQLite App->>Room: open database (v10 DB detected) Room->>Room: "apply AutoMigration(from=10, to=11)" Note over Room: @DeleteColumn drops nekoBean<br/>via table-copy strategy Room->>SQLite: CREATE new proxy_entities (without nekoBean) Room->>SQLite: INSERT INTO new SELECT ... FROM old Room->>SQLite: DROP TABLE old Room->>RemoveNekoColumn: onPostMigrate(db) RemoveNekoColumn->>SQLite: "DELETE FROM proxy_entities WHERE type = 999" RemoveNekoColumn-->>Room: done Room->>SQLite: UPDATE room_master_table SET identity_hash Room-->>App: database ready (v11)Reviews (10): Last reviewed commit: "chore(db): commit generated Room schema ..." | Re-trigger Greptile