Repository navigation
fix: a first-name card beside the full card is one person, not nobody - #173
Conversation
…t stall polling (nixfred#125 item 2) (nixfred#171) WHAT: collect() used to call runReadAction (spawnSync, 180 s timeout) inline, so one hung Mac call held the collector process for up to three minutes and every poll, toast and refresh queued behind it in BarWidget. The due read intent is now started by startReadAction in a detached `collector.ts --read-worker` process. The collector writes read-action.json first (one action at a time, which also keeps Messages' process-global selection to one user), the worker only adds `done` to it, and the collector stays the SOLE writer of state.json, folding the result in with settleReadAction on the poll that started it or a later one. The starting poll waits up to BLIP_READ_GRACE_MS (default 5 s) so the common 1 to 3 s action still reports its outcome in the same poll, as before. WHY: nixfred#125 item 2. The attempt is still persisted BEFORE the action starts, a failed intent is never dropped, backoff is counted from when the action ended, a worker silent past 190 s counts as a failure, and a result for an intent a newer gesture replaced is ignored. TESTS: a hung imsg-read no longer holds up polling (mutation: restoring the blocking wait makes it fail), later polls start nothing while it runs, its result is picked up by the next poll, a failure that ends after the poll left is kept with its error, settleReadAction unit cases, grace parsing. bun test: 944 pass, 1 fail (audio-waveform, needs ffmpeg, fails on main too). CLAUDE.md invariant amended: detached from the poll, never from its acknowledgement. LR-T: blip, read-sync, collector, worker, hung-imsg-read LR-D: blip LR-K: issue-125-item-2, read-action-worker, settleReadAction LR-L: law-9, law-10 Claude-Session: https://claude.ai/code/session_01BXN1v5rSKpVomPJvPhZCng Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Two cards in ONE Contacts source sharing a number were ambiguous unless
their names matched under _name_key (spacing, case, NFKC). A common
real-world duplicate fails that test: one card saved in a hurry as
"Alex", another saved properly as "Alex Rivera". Messages.app names the
conversation; Blip showed a bare number and no photo.
_same_person() extends the one-card-saved-twice rule: when one name's
words are the leading words of the other's, it is one person and the
fuller name wins. Words, not letters ("Ann" does not lead "Anna Smith");
different words ("Dana Park" / "Dana Reyes") stay two people, as before.
Longest-wins keeps card order out of it: Alex, Alex Rivera, Alex Lee is
nobody in any order. _vote (names) and _one_person (photos) share the
rule, so photos keep following names. The None-stays-None invariant
(Astra nixfred#2) is unchanged; cross-source ranking is untouched.
Tests: test_phone_match.py OneCardSavedTwice gains the prefix case
(fails before, passes after), a letters-not-words guard, and an
order-independence guard for three cards.
7d05a0c to
9d1c193
Compare
WHAT: Weekly contributor notes for the three changes landed today, with what was verified, and the open X-handle question for Nick (@k7cfo). LR-T: blip, weekly-notes, contributors LR-D: blip LR-K: w48, k7cfo, ianswope Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BXN1v5rSKpVomPJvPhZCng
|
Merged in The problem is exactly the sort that real address books have and test fixtures do not: the same person saved once in a hurry and once properly, and Blip answering with a bare number. Your rule is narrow and easy to reason about. Words and not letters, so What I measured on my own gateway, old bridge against new, over 3,159 handles: 2 gained a name, 0 lost one, and 1 changed, from a first name to the same name in full. That is your change doing precisely what you said it would. One limit I accepted and wrote into the CHANGELOG: We like to credit contributors by name when we post about Blip. I did not find an X account for you. If you have one you would like tagged, tell me the handle; "please do not tag me" is just as good an answer. Thank you again for making Blip better. Generated by Claude Code |
Problem
Two cards in one Contacts source that share a number are treated as ambiguous unless their names match under
_name_key(spacing, case, NFKC). A common duplicate fails that test: one card saved in a hurry asAlex, another saved properly asAlex Rivera. Messages.app names that conversation; Blip shows a bare number and no photo.On a real address book this pattern (
Name/Name Surname, or a full name with a trailing note) left several one-on-one conversations showing a bare number.Change
_same_person(a, b)inbridge/mac/imsgextends the existing one-card-saved-twice rule:_name_key: one person, first spelling stays (unchanged).Dana Park/Dana Reyesis still nobody (existing test), andAnn/Anna Smithis nobody (words, not letters).The longest name wins, so card order doesn't matter:
Alex,Alex Rivera,Alex Leeresolves to nobody in either order._vote(names) and_one_person(photos) share the rule, so photos still follow names. None-stays-None (Astra #2), cross-source ranking, and the exact-before-suffix rule (Astra C#2) are untouched.Tests
bridge/mac/test_phone_match.py,OneCardSavedTwice:test_a_first_name_card_beside_the_full_card_is_one_person: fails on main, passes here. Covers both card orders and photo candidates.test_leading_words_not_letters: guard.test_two_full_names_after_a_short_one_are_still_nobody: order-independence guard, names and photos.test_phone_match.pyis 30/30 OK.imsg_test.py,contacts_test.py,test_group_photo.py, andtest_serve.pyare OK.py_compileis clean.Live check: with the patched
imsgon a macOS 26 gateway, the prefix-duplicate conversations now show names and photos, and pairs with genuinely different names stay unnamed, as intended.bridge/mac/contacts(build_lookup_index, which backscontacts lookup) has its own, stricter ambiguity rule. I left it alone because it isn't on the display-name path.