Repository navigation
refactor: stop carrying anything for older versions, and send the config version with the overview - #95
Merged
Conversation
fylorn
force-pushed
the
refactor/drop-compat
branch
from
September 22, 2026 03:55
81c8cda to
8e06959
Compare
…fig version with the overview
The project has almost no users yet, so nothing is kept for older versions:
- The request database has one schema instead of a chain of migrations.
A database written by any other version starts over empty, together with
the stored bodies: request ids restart at 1, and old bodies would otherwise
show up under new requests. SCHEMA is 17, so every existing database is
rebuilt once. A failure always carries its code now, and Msg::plain is gone.
- Response types no longer default fields that only an older core would leave
out. CONTROL_API_VERSION is 6.
- A built-in rule id that does not exist is a config error, like a misspelled
field, instead of a warning kept for rules that might be renamed. The
built-in rules file moves to tw-config so validation can see the ids;
GuardDetail.unknown and the gateway's warnings are gone.
- Removed: the special error for `bind: lan`, the hint for the old
`key: { oauth }` shape, the `ext` tag kept for old history file names,
lenient reading of takeover records, the unused `version` in the rules file,
and the dead schema_supported.
Overview.config_version is the version an edit is based on, read from the file
on disk and sent with the data the edit is made from. The interface used to
read it once on its own at startup; when core was not listening yet, it never
got one, and every edit failed with "config version not loaded".
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
fylorn
force-pushed
the
refactor/drop-compat
branch
from
September 22, 2026 04:04
8e06959 to
784fd54
Compare
Merged
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.
The project has almost no users yet, so nothing is kept for older versions any more. This removes every piece of code whose only job was to cope with an older core, an older config file, or data written by an older version.
Request database
Db::create) instead of a chain of migrations.SCHEMAis 17.tw_store::opendeletes it together withblobs/and starts over. The bodies have to go too, because request ids restart at 1 and old bodies would otherwise show up under new requests.Msg::plainis gone. The enterprise repo does not call it.Protocol
#[serde(default)]on fields that were added after their struct. Those only mattered when the desktop app parsed JSON from an older core, and the two always ship together. Defaults paired withskip_serializing_if, and defaults on request types, stay.Overview.config_versionis new. It carries the version an edit is based on, read from the file on disk, and it arrives with the data the edit is made from. The interface used to read it separately, once, at startup. If core was not listening yet, it never got one, and every edit failed with "config version not loaded" no matter how long you waited.CONTROL_API_VERSIONis 6.Config
GuardDetail.unknown,Rules.warnings, and the gateway's warning loop are gone.bind: lan;key: { oauth }shape;exttag kept so old history file names stay readable;pathandfile_created_by_usno longer default);versionin the rules file;schema_supported.tests/listen.rsusedbind: lanas its example of a malformed bind. Without the special case,lanis a well-formed interface name, so the test now uses192.168.1.5@wifi.version: 1field and its "too new" check stay. It is a format marker with no migration machinery behind it, and removing it would make every existingconfig.yamlfail to load.Checks
cargo fmt --check,cargo clippy --workspace --all-targets -D warnings, andcargo test --workspace(1519 passed) all pass.scripts/smoke.sh: 51 passed, 0 failed. The memory figure over target was already there.🤖 Generated with Claude Code