Skip to content

fix: prevent multiple room creation requests on rapid taps#757

Open
dolliecoder wants to merge 1 commit intoAOSSIE-Org:masterfrom
dolliecoder:fix/prevent-multiple-room-creation
Open

fix: prevent multiple room creation requests on rapid taps#757
dolliecoder wants to merge 1 commit intoAOSSIE-Org:masterfrom
dolliecoder:fix/prevent-multiple-room-creation

Conversation

@dolliecoder
Copy link
Copy Markdown

@dolliecoder dolliecoder commented Feb 16, 2026

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

  • Bug Fixes
    • Prevented duplicate room creation requests by ignoring subsequent attempts while an operation is already in progress.

@dolliecoder dolliecoder requested a review from M4dhav as a code owner February 16, 2026 20:13
@github-actions
Copy link
Copy Markdown
Contributor

🎉 Welcome @dolliecoder!
Thank you for your pull request! Our team will review it soon. 🔍

  • Please ensure your PR follows the contribution guidelines. ✅
  • All automated tests should pass before merging. 🔄
  • If this PR fixes an issue, link it in the description. 🔗

We appreciate your contribution! 🚀

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 16, 2026

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

Walkthrough

Added an early return guard in CreateRoomController.createRoom to prevent method re-entry when an operation is already in progress. The guard checks the isLoading flag and returns early if true, preventing concurrent room creation requests from rapid button taps.

Changes

Cohort / File(s) Summary
Room Creation Guard
lib/controllers/create_room_controller.dart
Added early return guard (if (isLoading.value) return;) to prevent concurrent room creation requests when a request is already in progress.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A button tapped once, then twice, then thrice—
But now a guard prevents that vice!
With isLoading checked at the door,
No duplicate rooms forevermore. ✨

🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely describes the main change: adding a guard to prevent multiple room creation requests on rapid taps.
Linked Issues check ✅ Passed The pull request directly addresses issue #756 by implementing the early-return guard pattern as specified to prevent concurrent RoomService.createRoom calls.
Out of Scope Changes check ✅ Passed The changes are limited to adding a loading guard in CreateRoomController.createRoom, which is directly aligned with the stated objectives and issue #756.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into master

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

Prevent multiple room creation requests on rapid button taps

1 participant