#14429: feat(bluebubbles): handle iMessage edit events in webhook
channel: bluebubbles
stale
size: M
Cluster:
Bluebubbles iMessage Fixes
## Summary
- Detect iMessage edit events from BlueBubbles `updated-message` webhooks by checking for the `dateEdited` field
- Route edit events through the normal message pipeline instead of silently dropping them
- Tag edited messages with `[[edit:N]]` referencing the original message's short ID so the AI knows which message was corrected
- Update the reply cache with the new text so future references reflect the edit
## Problem
When a user edits an iMessage, BlueBubbles sends an `updated-message` webhook event. The existing handler only expected reactions/tapbacks from this event type. Non-reaction `updated-message` events (including edits) were silently dropped at the webhook handler level with "webhook ignored updated-message without reaction".
This meant edits were completely invisible to the AI — the original text persisted and the correction was lost.
## Changes
**`extensions/bluebubbles/src/monitor.ts`**:
- Added `dateEdited` field to `NormalizedWebhookMessage` type
- Added `dateEdited` parsing in `normalizeWebhookMessage()` (handles both camelCase and snake_case)
- Added `normalizeWebhookEdit()` function that identifies edits (has `dateEdited`, no `associatedMessageGuid`)
- Modified webhook handler to check for edits before dropping `updated-message` events
- Modified `processMessage()` to skip tapback detection for edits and format with `[[edit:N]]` tag
**`extensions/bluebubbles/src/monitor.test.ts`**:
- Added 4 tests covering: edit with cached original, delivery receipt ignored, from-me edit, and edit without prior cache
## Test plan
- [x] All 55 existing + new tests pass (`vitest run extensions/bluebubbles/src/monitor.test.ts`)
- [x] Zero TypeScript errors in changed files
- [ ] Manual test: send an iMessage, edit it, verify the AI receives `[[edit:N]] corrected text`
- [ ] Manual test: verify delivery/read receipts are still silently dropped
- [ ] Manual test: verify reactions/tapbacks still work correctly
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR teaches the BlueBubbles webhook monitor to treat `updated-message` payloads with a `dateEdited` field as message edits (instead of dropping them as “updated-message without reaction”). It normalizes the edit timestamp, routes edits through the normal message pipeline, prefixes edited bodies with an `[[edit…]]` tag, and updates the reply cache so later references use the edited text. Tests were added to cover edit vs receipt handling and from-me behavior.
Main issues to address before merge are around formatting/tagging: edited messages currently bypass reply tagging logic (so an edited reply can lose `[[reply_to:N]]` context), and the code often emits `[[edit]]` even though a shortId is assigned later in the same processing call for previously-unknown GUIDs.
<h3>Confidence Score: 3/5</h3>
- Mostly safe to merge after fixing edit-tag formatting edge cases.
- Core normalization/routing changes are straightforward and covered by tests, but the current body composition for edits drops reply context tags and can emit `[[edit]]` even when a shortId is available later in the same processing flow, which can reduce correctness of the AI context.
- extensions/bluebubbles/src/monitor.ts
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#16304: fix(bluebubbles): accept webhook message fields at top level
by MisterGuy420 · 2026-02-14
79.4%
#15240: fix(bluebubbles): URL dropped when sent in same iMessage bubble as ...
by yinghaosang · 2026-02-13
78.3%
#23483: fix(bluebubbles): key debounce by chat+sender instead of messageId
by saucesteals · 2026-02-22
78.0%
#23705: BlueBubbles: enrich webhook group participants from chat metadata
by marc726 · 2026-02-22
77.8%
#22564: fix(bluebubbles): include iMessage subject in message text
by lailoo · 2026-02-21
75.5%
#11494: fix(bluebubbles): skip typing indicator for tapback messages
by mcaxtr · 2026-02-07
74.8%
#19522: feat(bluebubbles): send TTS as native iMessage voice memos
by mwmacmahon · 2026-02-17
74.1%
#9701: feat: handle Signal message edits with [edited] marker (#9656)
by divol89 · 2026-02-05
73.9%
#2799: fix(imessage): prevent self-chat and outbound echo loops (#2585)
by Tfh-Yqf · 2026-01-27
72.6%
#23240: feat(telegram): Process inbound edited_message events
by GonzFC · 2026-02-22
72.3%