Repository navigation
[2FA Code Finder] Fix iMessage codes not showing on recent macOS - #32981
Open
maxpetretta wants to merge 2 commits into
Open
maxpetretta wants to merge 2 commits into
maxpetretta wants to merge 2 commits into
Conversation
On recent macOS versions message.text is usually NULL and the body only exists in attributedBody. The query cast that blob to text, which SQLite truncates at the first NUL byte, right before the message body, so the extension only ever saw "NSMutableAttributedString" and found no codes. Fetch attributedBody as hex, decode the NSString payload from the typedstream, and apply the code and search filters to the decoded text. Notification labels stored in message.text are still combined with the body. Refs raycast#29673, raycast#21910 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
|
Thank you for your first contribution! 🎉 🔔 @yuercl @thomaspaulmann @arronhunt @hitolaus @taschaub @omaerkhan @clins1994 you might want to have a look. You can use this guide to learn how to check out the Pull Request locally in order to test it. 📋 Quick checkout commandsBRANCH="fix/imessage-2fa-tahoe-blank"
FORK_URL="https://github.com/maxpetretta/extensions.git"
EXTENSION_NAME="imessage-2fa"
REPO_NAME="extensions"
git clone -n --depth=1 --filter=tree:0 -b $BRANCH $FORK_URL
cd $REPO_NAME
git sparse-checkout set --no-cone "extensions/$EXTENSION_NAME"
git checkout
cd "extensions/$EXTENSION_NAME"
npm install && npm run devWe're currently experiencing a high volume of incoming requests. As a result, the initial review may take up to 15 business days. |
Contributor
[Medium impact] The change affects iMessage code discovery in the 2FA Code Finder. The earlier missing-code issue remains partly unfixed and should be addressed before merging. SummaryRestores iMessage code detection when macOS stores message text only in
Reviews (2) · Last reviewed commit: "fix(imessage-2fa): limit results after f..." · Reviewed by Greptile |
The SQL query limited rows to 100 before the code and search filters, which now run on the decoded body, so newer unrelated messages could push an older code in the look back window out of the results. Scan up to 1000 messages in the window and apply the 100 result limit after filtering. Also add petretta to contributors. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Note
This PR was written by Claude Opus 5.5 (Anthropic's model, running in Claude Code) on behalf of @maxpetretta, who asked for the fix and confirmed it works on their Mac.
Description
Since the 2026-05-27 update (#28183, "Fix Time Sensitive iMessage codes"), the iMessage source finds no codes when
message.textis NULL and the body only exists inattributedBody. On macOS 26 that is most incoming messages: 388 of the 400 most recent on the test machine.The query read the body with
cast(message.attributedBody as text). SQLite cuts that cast off at the first NUL byte, and in the typedstream blob that byte comes just before the message body. Every such message reached the extension asstreamtyped…NSMutableAttributedString,extractCodefound nothing, and the list showed the empty view.Changes:
attributedBodywithhex()and decode the NSString payload from the typedstream indecodeAttributedBody(src/utils.ts). Handles 1, 2 and 4 byte lengths.combineMessageTextkeeps the Fix iMessage Time Sensitive code detection #28183 behaviour: a notification label such as "Time Sensitive" inmessage.textis still combined with the decoded body.useMessages, since SQL can no longer see the body. The candidate check is the same as the old globs, which all reduce to three consecutive digits or capitals.Fixes #29673. Probably also the cause of #28593. Related: #21910.
Testing
npm run dev, a newly received code appeared.chat.db: the old query path found a code in 0 of the last 400 incoming messages, and the decoded text found one in 31. All 24,889attributedBodyblobs from the past year have the NSString layout the decoder expects.npm test(47 passed),npm run lint(0 errors, existing warnings only),npm run build.Screencast
No UI changes. The list shows codes again.
Checklist
npm run buildand tested this distribution build in Raycastassetsfolder are used by the extension itself (no asset changes)READMEare located outside the metadata folder if they were not generated with our metadata tool (no README changes)🤖 Generated with Claude Code