bug: manual save can hang when triggered in rapid succession #259

Open
opened 2026-05-06 12:22:29 -07:00 by hikari · 0 comments
Owner

Description

deusmortis (2026-05-06) reported that the game sometimes hangs when manually saving rapidly ("save spam"). The game becomes unresponsive during the hang.

"sometimes it just hangs on my save spam dang lol"

Suspected Cause

If the save endpoint is called while a previous save request is still in flight, concurrent writes to the same game state document may cause a lock contention or an unhandled promise that freezes the UI. There may also be no debouncing or request deduplication on the client-side save trigger.

Expected Behaviour

Triggering manual save multiple times in quick succession should either:

  • Debounce: Only fire the most recent save after a short cooldown (e.g. 500–1000ms), OR
  • Queue: Silently discard additional save requests while one is in flight

The UI should never hang or become unresponsive due to save activity.

Suggested Fix

  1. Add a debounce or in-flight guard to the manual save button on the client (apps/web)
  2. Ensure the API save route handles concurrent writes gracefully (e.g. upsert with a timestamp guard)

Reporter

deusmortis, Discord #activity, 2026-05-06

This issue was created with help from Hikari~ 🌸

## Description `deusmortis` (2026-05-06) reported that the game sometimes hangs when manually saving rapidly ("save spam"). The game becomes unresponsive during the hang. > *"sometimes it just hangs on my save spam dang lol"* ## Suspected Cause If the save endpoint is called while a previous save request is still in flight, concurrent writes to the same game state document may cause a lock contention or an unhandled promise that freezes the UI. There may also be no debouncing or request deduplication on the client-side save trigger. ## Expected Behaviour Triggering manual save multiple times in quick succession should either: - **Debounce**: Only fire the most recent save after a short cooldown (e.g. 500–1000ms), OR - **Queue**: Silently discard additional save requests while one is in flight The UI should never hang or become unresponsive due to save activity. ## Suggested Fix 1. Add a debounce or in-flight guard to the manual save button on the client (`apps/web`) 2. Ensure the API save route handles concurrent writes gracefully (e.g. upsert with a timestamp guard) ## Reporter `deusmortis`, Discord #activity, 2026-05-06 ✨ This issue was created with help from Hikari~ 🌸
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: nhcarrigan/elysium#259