treat 410 as error if we already have a token#6538
Merged
Conversation
josevalim
approved these changes
Nov 19, 2025
Relates to: https://elixirforum.com/t/handling-channels-liveview-longpoll-fallback-unmatched-topic/72378 On mobile Safari (e.g. iOS) the following could happen when using LongPoll: 1. user connects to a channel 2. device goes to sleep 3. Phoenix shuts down long poll server 4. client connects again, server responds with 410 5. LongPoll continues as usual, but channels are not joined any more 6. client sends messages for previous channel 7. channel errors with "unmatched topic" but does not rejoin We handle this by checking if we already have a LongPoll token when receiving a 410 code and instead trigger an error which will cause a proper rejoin.
44eac37 to
baae0a0
Compare
filipecabaco
pushed a commit
to supabase/phoenix
that referenced
this pull request
Nov 26, 2025
* treat 410 as error if we already have a token Relates to: https://elixirforum.com/t/handling-channels-liveview-longpoll-fallback-unmatched-topic/72378 On mobile Safari (e.g. iOS) the following could happen when using LongPoll: 1. user connects to a channel 2. device goes to sleep 3. Phoenix shuts down long poll server 4. client connects again, server responds with 410 5. LongPoll continues as usual, but channels are not joined any more 6. client sends messages for previous channel 7. channel errors with "unmatched topic" but does not rejoin We handle this by checking if we already have a LongPoll token when receiving a 410 code and instead trigger an error which will cause a proper rejoin. * add unit test
|
For the record I was seeing this on MacOS 26.2, also. Thanks for the fix! |
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.
Relates to: https://elixirforum.com/t/handling-channels-liveview-longpoll-fallback-unmatched-topic/72378
On mobile Safari (e.g. iOS) the following could happen when using LongPoll:
We handle this by checking if we already have a LongPoll token when receiving a 410 code and instead trigger an error which will cause a proper rejoin.