fix(photon): disable iMessage data detection on styled sends - #88506
Closed
fluxkapacitor wants to merge 1 commit into
Closed
fluxkapacitor wants to merge 1 commit into
fluxkapacitor wants to merge 1 commit into
Conversation
Markdown messages containing raw URLs 500 in the iMessage provider: the styled send path (text + UTF-16 formatting ranges) defaults server-side data detection ON, and a URL in the text trips it. The previous workaround routed URL-bearing markdown to plain text, losing all formatting. Patch @spectrum-ts/imessage's two styled outbound call sites to pass enableDataDetection: false explicitly (sendContent markdown case and the group sendMultipart call), so URL-bearing markdown sends as ONE styled message with the URL embedded. Verified live against the real bridge: markdown + URL arrives as a single bubble, bold intact, link tappable. The sidecar no longer needs the chooseSendFormat URL-gate and sends markdown as markdown. send-format.mjs is left in place (its module-level tests still pass); removing the now-dead workaround is a follow-up.
fluxkapacitor
force-pushed
the
fix/photon-markdown-url-data-detection
branch
from
August 17, 2026 16:13
3ee4117 to
1e1289b
Compare
Contributor
Author
|
Closing — no longer needed. The styled+URL 500 is avoided on this project via a Photon-side setting ('replies as markdown?'), verified live with pure upstream code; running raw clean. Thanks for the merge of the original workaround in #73615 either way. |
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.
Summary
Markdown messages containing raw URLs 500 in the Photon iMessage provider. The styled send path (plain string + UTF-16 formatting ranges) never sets
enableDataDetectiononsendText, so the server defaults data detection ON for styled sends — and a raw URL in the text trips it. The previous workaround (send-format.mjschooseSendFormat) routed URL-bearing markdown to plain text, silently dropping all formatting.This PR fixes the class at the provider layer: the sidecar's existing pinned-SDK patch mechanism (
patch-spectrum-mixed-attachments.mjsprecedent) now rewrites@spectrum-ts/imessage's two styled outbound call sites to passenableDataDetection: falseexplicitly:sendContent'smarkdowncase →sendText(..., { enableDataDetection: false })(single-content sends — the path/senduses)send$1's group branch →sendMultipart(..., { enableDataDetection: false })(group/multipart sends — same 500 class on styled parts)Result: markdown with URLs sends as one styled message, URL embedded and auto-linked by iMessage. The sidecar's
/sendno longer needs the URL-gate and sends markdown as markdown. The patch joins the existingpostinstallchain so fresh installs get both patches.Why this shape
options.enableDataDetectionon bothsendTextandsendMultipart(see@photon-ai/advanced-imessage) — the provider just never passes it. Explicitfalseoverrides the server default; proven live (below).patch-spectrum-mixed-attachments.mjs); it self-heals existing installs without an npm bump, and spectrum-ts pins exactly because it ships breaking majors.Prior art (this is not a duplicate)
spectrum-ts@8.0.0, which still carries the bug. This patch is the pinned-SDK bridge; when Hermes bumps the pin past consistent hallucination? #156, the anchors fail loudly and the patch is retired.Verification
**bold** + https://example.comthrough the real provider → returnedmessageId, arrived as one bubble, bold intact, URL tappable. (Baseline: unstyled sends work; the styled+URL path is the documented 500.)test_url_markdown_patch.py(6 tests: applies to real anchors, idempotent via marker, fails loudly on reshaped SDK, fails loudly when SDK missing, preserves CRLF). Neighborstest_url_send_path.py+test_spectrum_patch.pygreen — 15/15.node --checkon both.mjsfiles;package.jsonJSON-valid.Follow-up (not in this diff)
send-format.mjs'schooseSendFormatis now unused by the sidecar (its module tests still pass). Removing the dead workaround is a separate cleanup — keeping this PR minimal.