Repository navigation
fix: the data directory is part of the contract - #139
Merged
Merged
Conversation
The desktop app resolved the data directory on its own, from HOME only. On Windows HOME is normally unset, so it fell back to `.thinkwatch` in the current directory while core used %APPDATA%\ThinkWatch. The port file and the token live in that directory: the app would look for a running gateway in the wrong place and never find it. The resolver moves from tw-config into tw-api as `tw_api::data::dir()`, next to `control::Endpoint`, which moved there for the same reason. The desktop app can then ask the same function instead of keeping a copy. tw-config's `default_dir` is gone; its callers use the new one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fylorn
force-pushed
the
fix/data-dir-in-contract
branch
from
September 23, 2026 12:30
cfdb5fd to
3ee751f
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 desktop app resolves the data directory itself (
data_dir()in lite'slib.rs), reading onlyHOME. On WindowsHOMEis normally unset, so it falls back to a relative.thinkwatchin the current directory, while core uses%APPDATA%\ThinkWatch. The control port file and token live in that directory, so on Windows the app would look for a running gateway in the wrong place and never connect.This moves the resolver (
Convention,pick, and its tests unchanged) from tw-config into tw-api astw_api::data::dir(), next tocontrol::Endpoint, which moved there for the same reason. lite will call it after the next core release instead of keeping its own copy.tw_config::default_diris removed;default_path, twcore, tw-adopt and tw-control calltw_api::data::dir().CONTROL_API_VERSIONis unchanged: nothing on the wire changes.Verification
cargo fmt --check,cargo clippy --all-targets -D warningsandcargo test --workspacepass on macOS. The moved tests cover both conventions on any host.🤖 Generated with Claude Code