Loading…
A short voice session: one question, one follow-up, then instant feedback — up to 5 minutes.
Actors isolate mutable state, but an await can allow other work on the actor before the method resumes. Recheck assumptions that may change across suspension.
Consider checking a cached balance, awaiting a remote authorization, and then changing local state. Another actor operation may run during suspension and change the balance or invalidate the request. Keep critical state transitions synchronous where possible, or validate versions and state again after awaiting. Use MainActor isolation for relevant UI state, and do not assume an async function always runs on a background thread.