fix: coalesce URL preview split sends#142
Conversation
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: fix: coalesce URL preview split sends This is item 1/1 in the current shard. Shard 0/1. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
|
Merged as 1c51609. Proof run before merge:
CI:
Caveat: no live Messages injection was needed for this chat.db/history/search/watch coalescing fix; validation is fixture-backed local tests plus CI. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3b6b437453
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return .suppress | ||
| } | ||
| ) | ||
| let visibleMessages = coalesced.filter { message in |
There was a problem hiding this comment.
Seed URL preview dedupe for coalesced previews
When a text row and its URL preview are coalesced in the same messagesAfterBatch, the preview row is suppressed before this dedupe filter runs, so shouldSkipURLBalloonDuplicate never records that preview. If Messages later appends another identical URLBalloonProvider row for the same link (the existing cross-poll dedupe tests cover this duplicate-row behavior), precedingTextMessageForURLPreview sees the prior preview row rather than the text row and returns nil, and the duplicate is emitted as a standalone message/watch notification. Record suppressed preview rows in the dedupe cache or make the fallback skip prior URL preview rows so coalescing still preserves the duplicate suppression guarantee.
Useful? React with 👍 / 👎.
Closes #141.
Summary
com.apple.messages.URLBalloonProvidersplit-send rows into one logical message for history, search, and watch/messagesAfter.balloon_bundle_idwhile adding nestedurl_previewmetadata for the folded preview row.MessageStoreboundaries.Proof
make formatmake lint(passes; existing non-serious warnings only)swift test --filter URLPreviewmake test(349 tests)make build(buildsbin/imsgandbin/imsg-bridge-helper.dylib; existingNSKeyedUnarchiver unarchiveObjectWithData:deprecation warning only)/Users/steipete/Projects/agent-skills/skills/autoreview/scripts/autoreview --mode localclean