Skip to content

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
mainfrom
feature/system-id-shared-file
Draft

fix: read the add-on's persisted system_id when no flag is given [on hold: ownership]#28
PetrDlouhy wants to merge 2 commits into
mainfrom
feature/system-id-shared-file

Conversation

@PetrDlouhy

Copy link
Copy Markdown
Contributor

Tied to an open design question (see BlenderKit add-on #2228): should the machine ID be owned by the add-on or by the Client? This PR implements the add-on-owned version. If we decide the Client should own it, this is the file where the writing would move.

Follow-up to #24, which added --system_id.

Problem

The add-on passes --system_id only 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, gofmt clean. Cross-checked end-to-end that the Python writer and this reader agree on the same path and value, including XDG_DATA_HOME.

🤖 Generated with Claude Code

PetrDlouhy and others added 2 commits July 28, 2026 17:52
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>
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.

1 participant