Take the cancellation token off four short Api mutations, or make them jobs #180

Closed
opened 2026-10-26 17:56:27 -05:00 by ethan-hann · 1 comment
Owner

.agents/coding-standards/core-api-results-and-errors.md (rule "Match the token to the kind of call") says a read takes a CancellationToken, a long job is cancelled through IJobsApi.CancelAsync, and a short mutation takes no token. These mutations take one:

  • IAppStatusApi.UseStorageFolderAsync
  • IAppStatusApi.RecoverCatalogFileAsync
  • IAppStatusApi.StartWithEmptyStorageAsync
  • IGamesApi.ExportDefinitionAsync

For each, decide first: if it finishes quickly, drop the token. If it can run long enough that a player wants to stop it, make it a job that returns JobStarted. Update the fake backend and the callers in the App with it.

`.agents/coding-standards/core-api-results-and-errors.md` (rule "Match the token to the kind of call") says a read takes a `CancellationToken`, a long job is cancelled through `IJobsApi.CancelAsync`, and a short mutation takes no token. These mutations take one: - `IAppStatusApi.UseStorageFolderAsync` - `IAppStatusApi.RecoverCatalogFileAsync` - `IAppStatusApi.StartWithEmptyStorageAsync` - `IGamesApi.ExportDefinitionAsync` For each, decide first: if it finishes quickly, drop the token. If it can run long enough that a player wants to stop it, make it a job that returns `JobStarted`. Update the fake backend and the callers in the App with it.
ethan-hann added this to the Code Cleanup milestone 2026-10-26 17:56:27 -05:00
Author
Owner

Shipped in 0.9.17 (PR 227).

Shipped in [0.9.17](https://git.tortal.tech/ethan-hann/SavePoint/releases/tag/v0.9.17) (PR 227).
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ethan-hann/SavePoint#180
No description provided.