messagix/instagram: treat missing Instagram thread as already deleted#263
Open
iFixRobots wants to merge 1 commit intomainfrom
Open
messagix/instagram: treat missing Instagram thread as already deleted#263iFixRobots wants to merge 1 commit intomainfrom
iFixRobots wants to merge 1 commit intomainfrom
Conversation
When deleting an Instagram chat that was already removed on the native app, the route definition endpoint returns 200 but with an empty thread_fbid. Previously this caused a FAIL_RETRIABLE error loop since the bridge kept retrying a deletion that could never succeed. Add ErrIGThreadNotFound sentinel error to fetchRouteDefinition so DeleteThread can detect this case with errors.Is and return nil, allowing the client to clean up the room locally. Fixes PLAT-36131
tulir
approved these changes
Apr 21, 2026
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.
Problem
When deleting an Instagram chat from Beeper that was already removed on the native Instagram app, the bridge enters an infinite retry loop.
The
DeleteThreadflow callsfetchRouteDefinition→POST /ajax/route-definition/to resolve thethread_fbid. When the thread no longer exists on Instagram, the endpoint returns 200 OK but with an emptythread_fbid, causing:The
FAIL_RETRIABLEstatus causes the client to retry indefinitely — a deletion that can never succeed.Fix
ErrIGThreadNotFoundsentinel error variable tofetchRouteDefinition(using%wwrapping)DeleteThread, check for this error witherrors.Isand returnnil— the chat is already gone, so the deletion intent is fulfilledPer Tulir's guidance in the ticket comments.
Impact
DeleteThreadpath — all other callers offetchRouteDefinitionare unaffectedFixes https://linear.app/beeper/issue/PLAT-36131