fix: guard ActionSheet hide() to skip side effects when not visible - #7509
Conversation
hide() was called on cold start via 3 redundant VoIP reset paths (disconnect, checkVoipPermission, PERMISSIONS.SET re-check), each firing Haptics.impactAsync and other side effects despite no sheet being open. Adding !isVisible guard makes these no-ops.
WalkthroughThe ActionSheet ChangesActionSheet visibility handling
Estimated code review effort: 1 (Trivial) | ~2 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Android Build Available Rocket.Chat 4.75.0.109397 Internal App Sharing: https://play.google.com/apps/test/RQQ8k09hlnQ/ahAO29uNT3cAiCrupi42j8TWzy2fAZ1fGrDSXG8pIJBAn3jpBp8IsBVkotsbY4O3cVE3XYuoBmuizm42VXO_uywzQV |
|
iOS Build Available Rocket.Chat 4.75.0.109398 |
The base branch was rebased, so its 13 commits (the five reverts plus follow-ups) arrived with new SHAs while dry-badger already carried them as identical patches. Every conflict is that duplicate content, resolved to dry-badger's side, which keeps the socket health work layered on top. Only #7509 (ActionSheet hide guard) and #7510 (UserPreferences.getBool) are new here. jest.config.js keeps the @rocket.chat/sdk and tiny-events transform entries that ddpSocket.test.ts needs; the rebased base dropped them along with the test file it deleted.
Proposed changes
Guard
ActionSheet.hide()to skip all side effects (haptic, keyboard dismiss) when no sheet is visible. On cold start,hideActionSheetRef()was called 3 times via redundant VoIP reset paths —disconnect(),checkVoipPermission, and thePERMISSIONS.SETre-check — each firingHaptics.impactAsyncdespite no sheet being open.Issue(s)
https://rocketchat.atlassian.net/browse/SUP-1079
How to test or reproduce
Screenshots
N/A
Types of changes
Checklist
Summary by CodeRabbit