Ensure proper await handling for database operations and updates#123
Merged
bitbacchus merged 6 commits intoMay 21, 2026
Merged
Conversation
DeleteQuestion sent the groups patch with fire-and-forget `send` (the `await` was a no-op on void), so the question could be removed from the QuestionActor before QuizActor had processed the groups update, leaving dangling group references under load. https://claude.ai/code/session_01DUUFUFpsvj4y6xU5172pX4
storeEntity was fire-and-forget: the MongoDB write could fail silently while the caller already received a success reply. On any write error or process restart the session was lost, effectively logging the user out with no warning. Also refactors the async-inside-create pattern out: getEntity is now awaited before create(), and create() is synchronous, which avoids nested create() races introduced by storeEntity's own internal cache update. https://claude.ai/code/session_01DUUFUFpsvj4y6xU5172pX4
The ask+send block inside a synchronous create() callback was fire-and-forget: the admin got a success reply before the session role was updated, leaving a window where a downgraded user still held their old permissions. Moves the session update after storeEntity completes, uses ask for StoreSession (now that StoreSession awaits its own write), and guards against users with no active session. https://claude.ai/code/session_01DUUFUFpsvj4y6xU5172pX4
Block, Unblock, IncreaseCount, and StoreFingerprint all called storeEntity without await inside synchronous .match() callbacks. A MongoDB write failure was silently discarded, so a blocked fingerprint could revert to unblocked after a process restart. Restructures each handler to extract the fingerprint via early-return rather than .match(), allowing storeEntity to be properly awaited before notifying subscribers. https://claude.ai/code/session_01DUUFUFpsvj4y6xU5172pX4
…csActor Quiz answer statistics were broadcast to all subscribers and returned to the caller before the MongoDB write completed. A write failure was silently swallowed, leaving subscribers with data that was never persisted. https://claude.ai/code/session_01DUUFUFpsvj4y6xU5172pX4
ChangeNicknameModal: .ask().then() had no .catch(), so a UserStore network error propagated as an unhandled rejection and the uniqueness error was silently lost. SharingActor.AddEntry: same pattern — a UserStore rejection on teacher lookup left the sharing dialog with no feedback. Now maps the rejection to a queryNotFound error entry so the UI shows an explicit failure rather than silently doing nothing. https://claude.ai/code/session_01DUUFUFpsvj4y6xU5172pX4
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
needs more review and testing before merging