Skip to content

fix(contacts): require a unique match before read or export - #4

Merged
freanocank merged 4 commits into
freanocank:mainfrom
ShiTan-677:fix/ambiguous-contacts
Oct 13, 2026
Merged

freanocank merged 4 commits into
freanocank:mainfrom
ShiTan-677:fix/ambiguous-contacts

Conversation

@ShiTan-677

@ShiTan-677 ShiTan-677 commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

When a name matches two to five contacts, read_chat() reads every matched conversation and the export CLI silently selects the first. Only more than five matches were rejected, despite the existing Skill/MCP guidance to ask for a selection.

Reject every non-unique match before fetching message contents or opening an output file. Return/display candidate wxids so callers can retry with an exact identifier. The no-match and single-match behavior remains supported.

Validation on macOS / Python 3.12:

  • Before the fix, the read/export regressions failed for two and five matches.
  • python -m pytest -q: 91 passed, 1 skipped.
  • Synthetic tests cover two, five and six candidates, exact-identifier selection, no match, and preservation of an existing export file when selection is ambiguous.
  • Compilation, macOS shell syntax and six-tool MCP loading checks passed.

Export-selection fixtures are uncompressed, so they stub only the optional zstd availability gate. Modern timestamps and explicit UTF-8 keep the synthetic exports portable across macOS and Windows.

This PR is independent of the sender-direction fix. It contains only synthetic contact fixtures, without personal chat data or keys. The final fork CI matrix passed on macOS and Windows with Python 3.10 and 3.13: run 38039930827, at commit 80942a0. The upstream fork-PR workflow still requires maintainer approval.

@freanocank
freanocank merged commit b0f4b90 into freanocank:main Oct 13, 2026
1 check passed
@freanocank

Copy link
Copy Markdown
Owner

Thanks for the fix and regression tests. Adopted through #15 with your original commits preserved. Ambiguous names now require an exact contact selection before message reads or export writes.

The combined suite passes all four macOS/Windows × Python 3.10/3.13 CI jobs; Windows reports 209 passed, and macOS reports 208 passed with the Windows-only test skipped.

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