fix: prevent multiple room creation requests on rapid taps#757
fix: prevent multiple room creation requests on rapid taps#757dolliecoder wants to merge 1 commit intoAOSSIE-Org:masterfrom
Conversation
|
🎉 Welcome @dolliecoder!
We appreciate your contribution! 🚀 |
|
No actionable comments were generated in the recent review. 🎉 📝 WalkthroughWalkthroughAdded an early return guard in Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
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 |
This PR prevents multiple room creation requests from being triggered when a user taps the "Create Room" button rapidly.
The createRoom() method in CreateRoomController did not previously guard against repeated invocations while an async request was already in progress. This could potentially lead to duplicate backend calls and unintended room creation.
A simple defensive guard has been added at the start of the method to ignore additional taps while isLoading is true.
Fixes #756
Type of change
Bug fix (non-breaking change which fixes an issue)
How Has This Been Tested?
This change was validated through static code analysis. The guard ensures that when isLoading is already true, additional calls to createRoom() return immediately, preventing concurrent backend requests.
No functional behavior was altered beyond preventing duplicate execution.
Checklist:
My code follows the style guidelines of this project
I have performed a self-review of my own code
My changes generate no new warnings
I have checked my code and corrected any misspellings
Summary by CodeRabbit