AOSSIE-Org / AOSSIE-Org/Resonate

Prevent multiple room creation requests on rapid button taps

オープン
#756 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Dart
スター
344
フォーク
350
PR マージ指標
30日以内にマージされた PR はありません

説明

### 🐛 Describe the bug

The createRoom() method in CreateRoomController does not prevent multiple rapid invocations while a room creation request is already in progress.

Since the method performs an asynchronous backend call (RoomService.createRoom), repeated taps on the "Create Room" button before the first request completes can trigger multiple concurrent room creation requests.

This may result in:
Duplicate rooms being created
Multiple bottom sheets opening
Unnecessary backend writes

This issue is similar in pattern to the previously resolved duplicate async call issue (#612), where a loading guard was added to prevent repeated execution.

Sample code to reproduce the problem

## Sample code to reproduce the problem

```dart
Future createRoom(...) async {
try {
isLoading.value = true;

await RoomService.createRoom(
roomName: name,
roomDescription: description,
roomTags: tags,
adminUid: authStateController.uid!,
);

} finally {
isLoading.value = false;
}
}
```

There is no early return guard such as:

```dart
if (isLoading.value) return;
```

This allows multiple rapid invocations of the method before the first async call completes.

Observed behavior

When the method is triggered multiple times before the first async call completes, multiple backend requests may be sent to create rooms concurrently.

No exception is thrown, but duplicate side effects are possible due to lack of concurrency protection.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。