Prevent duplicate Peer Info screens on rapid chat-title taps#2200
Open
bojanstef wants to merge 1 commit into
Open
Prevent duplicate Peer Info screens on rapid chat-title taps#2200bojanstef wants to merge 1 commit into
bojanstef wants to merge 1 commit into
Conversation
The chat title bar opens the peer's Info screen via the openChatInfo navigation action, which had no re-entrancy guard. Tapping the title in quick succession ran the full path on every tap and pushed a separate PeerInfoScreen each time, so several identical Info screens ended up stacked on top of each other and the user had to press Back once per tap to return to the chat. Route every Info push in openChatInfo through a helper that skips the push when this peer's Info screen is already on top of the navigation stack. The first tap opens Info as before; the remaining taps in a burst become no-ops. All five Info-push sites in the action go through the guard. Fix TelegramMessenger#2185 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
bojanstef
commented
Jun 15, 2026
Comment on lines
+720
to
+723
| // #2185: rapid title-bar taps each pushed a new PeerInfoScreen, so a fast burst | ||
| // opened several stacked Info screens. Route every Info push through this guard: | ||
| // if this peer's Info is already on top of the navigation stack, treat the extra | ||
| // tap as a no-op instead of pushing a duplicate. |
Author
There was a problem hiding this comment.
LMK if you think I should remove the comments. @laktyushin
- remove comments please
- leave them
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.
Rapidly tapping a chat's title bar opened a separate Peer Info screen on every tap, leaving several identical Info screens stacked on top of one another — you had to press Back once per tap to get back to the chat.
Cause. The title bar opens the peer's Info screen through the
openChatInfonavigation action, which had no re-entrancy guard. Each tap in a quick burst ran the full path and pushed anotherPeerInfoScreen.Fix.
openChatInfonow routes every Info push through a small helper,pushPeerInfoControllerAvoidingDuplicate(_:), that skips the push when the top of the navigation stack is already aPeerInfoScreenImplfor the same peer. The first tap opens Info exactly as before; the remaining taps in a burst become no-ops. All five Info-push sites in the action go through the guard (the regular 1:1 / group path plus the Saved Messages, forum-topic, monoforum and channel-forum paths).Testing. Built
//Telegram:Telegramand ran on the iPhone 16 simulator:Fixes #2185