Skip to content

fix: coalesce URL preview split sends#142

Merged
steipete merged 1 commit into
mainfrom
fix/url-preview-coalescing
Jun 10, 2026
Merged

fix: coalesce URL preview split sends#142
steipete merged 1 commit into
mainfrom
fix/url-preview-coalescing

Conversation

@steipete

Copy link
Copy Markdown
Collaborator

Closes #141.

Summary

  • Coalesce Apple com.apple.messages.URLBalloonProvider split-send rows into one logical message for history, search, and watch/messagesAfter.
  • Preserve raw balloon_bundle_id while adding nested url_preview metadata for the folded preview row.
  • Keep public/watch cursors moving across suppressed previews, preserve logical limits after coalescing, and leave standalone/duplicate URL balloons covered by the existing dedupe path.
  • Split large model/query helpers while keeping behavior local to existing MessageStore boundaries.

Proof

  • make format
  • make lint (passes; existing non-serious warnings only)
  • swift test --filter URLPreview
  • make test (349 tests)
  • make build (builds bin/imsg and bin/imsg-bridge-helper.dylib; existing NSKeyedUnarchiver unarchiveObjectWithData: deprecation warning only)
  • /Users/steipete/Projects/agent-skills/skills/autoreview/scripts/autoreview --mode local clean

@clawsweeper

clawsweeper Bot commented Jun 10, 2026

Copy link
Copy Markdown

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.

@steipete steipete merged commit 1c51609 into main Jun 10, 2026
2 checks passed
@steipete steipete deleted the fix/url-preview-coalescing branch June 10, 2026 09:04
@steipete

Copy link
Copy Markdown
Collaborator Author

Merged as 1c51609.

Proof run before merge:

  • make format
  • make lint (passes; existing non-serious warnings only)
  • swift test --filter URLPreview (19 URL-preview-focused tests)
  • make test (349 tests)
  • make build (built bin/imsg and bin/imsg-bridge-helper.dylib; existing NSKeyedUnarchiver unarchiveObjectWithData: deprecation warning only)
  • /Users/steipete/Projects/agent-skills/skills/autoreview/scripts/autoreview --mode local clean

CI:

  • linux-read-core passed in 1m13s
  • macos passed in 2m3s

Caveat: no live Messages injection was needed for this chat.db/history/search/watch coalescing fix; validation is fixture-backed local tests plus CI.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

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.

Coalesce Apple URL-preview split-sends into a single notification

1 participant