claude/fix hostname from dbjson 9a1f40de - #21
Merged
Merged
Conversation
twistedmelonman
commented
Jul 14, 2026
Member
- docs: design db.json hostname resolution for list-clients
- fix(list-clients): resolve real hostnames from Synergy db.json
added 2 commits
July 14, 2026 14:28
Root cause of the arich-mac lock failure: Synergy sanitizes the internal hyphen out of the screen name before writing synergy.conf, so the conf already reads arichmac-3181d4b4. The list-clients suffix-strip regex is innocent. The real display name lives in the sibling db.json, joinable on the last 8 hex of its id field. Resolve via the name field (not hostname, which diverges and would break mimolette), with jq + fallback to today's heuristic.
A client whose real name is arich-mac.local never locked: Synergy sanitizes
the hyphen out of the screen name before writing synergy.conf, so the conf
reads 'arichmac-3181d4b4' and list-clients emitted the unresolvable
'arichmac.local'. The suffix-strip regex was innocent — the hyphen was gone
upstream, in Synergy.
Recover the true display name from the sibling db.json, joining the conf's
8-hex instance suffix against the last 8 hex of each computers[].id. Use the
'name' field, not 'hostname' (they diverge; hostname can be the default
'Andrews-Mac-mini.local' and would break the working mimolette client).
Runtime-hardened for the LaunchAgent: kept bash-3.2 compatible (glob with
explicit character classes, no BASH_REMATCH or {8} interval, no assoc arrays)
since launchd's minimal PATH selects system bash 3.2, and resolve jq by
absolute path (probing Homebrew locations) since launchd's PATH excludes
Homebrew. Degrades to the old suffix-strip heuristic when jq or db.json is
absent, so no host is ever worse off than before. db.json path overridable
via LOCK_SYNC_DB.
Verified against the real conf and under a launchd-equivalent runtime
(minimal PATH + /bin/bash 3.2.57). Adds 7 bats cases; suite 40/40,
shellcheck clean.
|
The change adds db.json-based hostname resolution to
No bugs, regressions, security issues, or data-loss risks found. VERDICT: PASS |
The "Fallback / anti-regression:" test cases restarted the ordered list but continued numbering 5-7, tripping markdownlint MD029 (style 1/2/3). Renumber the second list to 1-3. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The PR adds No blocking issues found. Key correctness points verified:
VERDICT: PASS |
|
The PR adds No blocking issues found. Key correctness points verified:
VERDICT: PASS |
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.