Skip to content

Add FlushUpdates and events for players/saves debounced updates#227

Open
tudddorrr wants to merge 1 commit into
developfrom
flush-debounced-updates
Open

Add FlushUpdates and events for players/saves debounced updates#227
tudddorrr wants to merge 1 commit into
developfrom
flush-debounced-updates

Conversation

@tudddorrr

@tudddorrr tudddorrr commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Debounced update completion signals

  • New OnPlayerUpdated/OnPlayerUpdateFailed and OnSaveUpdated/OnSaveUpdateFailed events fire after each settled debounced batch, so callers can react to success or failure of player/save updates
  • New FlushUpdates() method on both PlayersAPI and SavesAPI forces any pending trailing debounced call to execute immediately and returns an awaitable Task<bool>, enabling deterministic flush-on-quit scenarios
  • The base DebouncedAPI tracks the current executing Task per operation and surfaces completion/failure through internal events, replacing the previous fire-and-forget ContinueWith pattern that only logged errors

Saves API correctness

  • ExecuteDebouncedOperation for saves now returns the updated GameSave from the server and throws if no save is currently loaded (instead of silently skipping), ensuring callers always receive the canonical server state

@tudddorrr tudddorrr added the enhancement New feature or request label Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant