fix(notifications): MAP messages notify after iOS auto-reads them (tincan-ps152)#61
Merged
Conversation
…till notify (tincan-ps152) iOS MAP auto-marks messages as read when they are fetched (GetMessage). _emit_messages set status='read' for msg['read']=True, but _should_notify requires status='unread'/'new' OR is_new=True to fire a notification. Without is_new the second+ message from any conversation where the phone already read the message was silently dropped. Add is_new=True to msg_dict for all notify=True inbound messages. The notify flag already gates genuinely-new-to-tincan messages via filter_new()/seen-handles dedup, so is_new=True here is correct. 1204 tests pass. Co-Authored-By: Claude Sonnet 4.6 <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.
What this changes
On iOS, when the iPhone fetches a message body over MAP (the
GetMessagecall), iOS marksthe message as read on the phone immediately. Tincan's
_emit_messagessetstatus='read'to reflect this — but
_should_notifyin the notification pipeline requires eitherstatus='unread'/'new'oris_new=Trueto fire a desktop notification. The result wasthat only the first message in a conversation ever produced a notification; every
subsequent message was silently dropped.
The fix adds
is_new=Trueto the message dict for everynotify=Trueinbound messagein
_emit_messages. Thenotifyflag is already set upstream byfilter_new()and theseen-handles dedup, so
is_new=Truehere is safe: only genuinely new-to-tincan inboundmessages can reach this path. Outbound messages and the initial-poll baseline
(
notify=False) cannot receiveis_new=True.Review notes
tincand/backends/bluez_map.py:958— a single boolean expression replacingthe previously absent field.
tincan-vlxtbis filed to add a unit test directly on_emit_messagesfor the
is_newpath (non-blocking for this PR).Test plan
QT_QPA_PLATFORM=offscreen python -m pytest tests/ -q→ 1205 passed, 0 failedruff check tincand/ tincan_gui/→ all checks passedrelease-gates/tincan-ps152-gate.md