Skip to content

Prevent duplicate Peer Info screens on rapid chat-title taps#2200

Open
bojanstef wants to merge 1 commit into
TelegramMessenger:masterfrom
bojanstef:fix-2185-duplicate-peer-info-screens
Open

Prevent duplicate Peer Info screens on rapid chat-title taps#2200
bojanstef wants to merge 1 commit into
TelegramMessenger:masterfrom
bojanstef:fix-2185-duplicate-peer-info-screens

Conversation

@bojanstef

Copy link
Copy Markdown

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 openChatInfo navigation action, which had no re-entrancy guard. Each tap in a quick burst ran the full path and pushed another PeerInfoScreen.

Fix. openChatInfo now routes every Info push through a small helper, pushPeerInfoControllerAvoidingDuplicate(_:), that skips the push when the top of the navigation stack is already a PeerInfoScreenImpl for 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:Telegram and ran on the iPhone 16 simulator:

  • Single tap — Info opens as before (no regression).
  • Rapid burst of taps — a single Info screen opens; one Back press returns to the chat.

Fixes #2185

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>
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.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LMK if you think I should remove the comments. @laktyushin

  • remove comments please
  • leave them

@CLAassistant

CLAassistant commented Jun 15, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Double-clicking a group tab opens duplicate windows

2 participants