Skip to content

fix(config): read isolated-root config.toml instead of config-<profile>.toml - #132

Merged
ErikBjare merged 2 commits into
ActivityWatch:masterfrom
TimeToBuildBob:bob/isolated-root-config
Sep 8, 2026
Merged

ErikBjare merged 2 commits into
ActivityWatch:masterfrom
TimeToBuildBob:bob/isolated-root-config

Conversation

@TimeToBuildBob

Copy link
Copy Markdown
Contributor

Why

activitywatch#1434 baked profile=research and port 5667 into the research build, but noted a pre-existing lookup mismatch: aw-qt reads config-<profile>.toml for the rust server's port while aw-server-rust writes bare config.toml in isolated profile roots (activitywatch-research/aw-server-rust/config.toml). The tray then misses the baked 5667 and falls back to 5600.

Erik asked to fix that on #1434: aw-qt should use isolated roots too.

What

  • Port lookup now sets AW_PROFILE for the target profile so aw-core dirs resolve activitywatch-<profile>/.
  • Isolated roots (including a fresh activitywatch-testing/) read bare config.toml and [server], matching aw-server-rust#652 / aw-core#152.
  • config-testing.toml / [server-testing] stay legacy-only (testing data still on the shared activitywatch/ root).
  • Pre-isolation config-<profile>.toml / [server-<profile>] remain a fallback so an old shared-root file is not silently ignored.
  • aw-core bumped to ^0.5.18 for using_legacy_testing_root.

Companion: ActivityWatch/aw-server (same isolated-root [server] change on the python server).

Tests

pytest tests/test_profile_config.py tests/test_profile.py: 33 passed (XDG-isolated; covers bare config.toml, [server], suffixed fallback, and legacy config-testing.toml).

Refs: ActivityWatch/activitywatch#1434

…e>.toml

aw-server-rust writes bare config.toml under activitywatch-<profile>/.
aw-qt still looked for config-<profile>.toml (and [server-<profile>]) in
whatever dir AW_PROFILE currently pointed at, so a research instance
never saw the rust server's port.

Lookup now sets AW_PROFILE for the target profile, reads config.toml /
[server] in the isolated root, and only uses the legacy suffixed names
when testing still lives on the shared activitywatch/ root.

Refs: ActivityWatch/activitywatch#1434
@greptile-apps

greptile-apps Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This revision fixes the previously reported legacy-root mismatch while retaining isolated-profile configuration precedence.

  • Named profiles first read bare server and aw-qt configuration from their isolated root.
  • If isolated configuration is absent, pre-isolation suffixed settings are read from the shared activitywatch/ root.
  • Tests now cover shared-root fallbacks and verify that isolated configuration wins.
  • The aw-core dependency is updated to 0.5.18 for testing-root detection.

Confidence Score: 5/5

The PR appears safe to merge; the legacy shared-root fallback is now restored without overriding isolated-profile configuration.

The previous configuration-fallback finding is fully fixed: Rust server files, Python server sections, and aw-qt sections are now searched under the shared default root only after isolated configuration misses, with tests covering both fallback and precedence.

Important Files Changed

Filename Overview
aw_qt/config.py Correctly redirects named-profile legacy fallbacks to the shared root while preserving isolated configuration precedence.
tests/test_profile_config.py Adds focused coverage for Rust, Python-server, and aw-qt shared-root fallbacks and precedence.
aw_qt/profile.py Updates profile documentation to describe isolated and legacy configuration resolution.
pyproject.toml Raises the aw-core minimum compatible version to include testing-root detection.
poetry.lock Locks aw-core 0.5.18 and the corresponding resolved metadata.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    P[Selected profile] --> I[Resolve isolated profile root]
    I --> C{Bare isolated config has setting?}
    C -->|Yes| U[Use isolated setting]
    C -->|No, named profile| S[Read suffixed setting from shared root]
    C -->|No, default/testing| D[Use normal fallback behavior]
    S --> F{Legacy setting found?}
    F -->|Yes| L[Use legacy setting]
    F -->|No| D
Loading

Reviews (2): Last reviewed commit: "fix(config): look up pre-isolation profi..." | Re-trigger Greptile

Comment thread aw_qt/config.py Outdated
Isolated-root lookup set AW_PROFILE first, so the config-<profile>.toml
/ [server-<profile>] / [aw-qt-<profile>] fallbacks ran inside
activitywatch-<profile>/ instead of the pre-isolation activitywatch/
root. Existing named profiles then lost their port and module list.

Search the shared root for those suffixed files/sections after the
isolated bare config misses.
@TimeToBuildBob

Copy link
Copy Markdown
Contributor Author

@greptileai review

@ErikBjare
ErikBjare merged commit e285e77 into ActivityWatch:master Sep 8, 2026
4 checks passed
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.

2 participants