fix: read the add-on's persisted system_id when no flag is given [on hold: ownership] - #28
Draft
PetrDlouhy wants to merge 2 commits into
Draft
fix: read the add-on's persisted system_id when no flag is given [on hold: ownership]#28PetrDlouhy wants to merge 2 commits into
PetrDlouhy wants to merge 2 commits into
Conversation
Follow-up to #24, which added --system_id. The add-on only passes that flag to a Client it spawns itself: a standalone Client (tray app), or one started by another software's add-on, kept falling back to the MAC-derived ID while the add-on used the persisted one - the same machine reporting two IDs, which breaks exactly the machine<->login join the stable ID exists for. Precedence is now --system_id > the persisted file > MAC-derived. The Client only reads the file; the add-on remains its sole writer. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Follow-up to #24, which added
--system_id.Problem
The add-on passes
--system_idonly to a Client it spawns. A standalone Client (tray app), or one started by another software's add-on, gets no flag and falls back to the MAC-derived ID — while the add-on reports the persisted one. The same machine then reports two different IDs, breaking precisely the machine↔login join the stable ID exists for.Change
Precedence becomes
--system_id> the ID the add-on persisted (<data dir>/system_id) > MAC-derived. The Client only ever reads the file; the add-on stays its sole writer, so there is one source of truth and no duplicated write logic across languages.Tests
TestPersistedSystemID(missing / valid / garbage file → falls back to MAC). Full suite,go vet,gofmtclean. Cross-checked end-to-end that the Python writer and this reader agree on the same path and value, includingXDG_DATA_HOME.🤖 Generated with Claude Code