Retry URLSession Requests Without Duplicating Writes
Separate transient failures from safe-to-repeat operations, keep one idempotency key per user action, and test a bounded retry policy without waiting through real delays.
Read moreShowing 13–19 of 19 posts
Separate transient failures from safe-to-repeat operations, keep one idempotency key per user action, and test a bounded retry policy without waiting through real delays.
Read moreReplace timing guesses with a controlled response fixture, assert intermediate loading state, and use Swift Testing confirmations around work you actually await.
Read moreWrap NWPathMonitor in AsyncStream with bounded buffering, cancellation cleanup, and an explicit stop handle so leaving a loop also releases its underlying work.
Read moreAn actor can still cache an obsolete response after invalidation. Share in-flight tasks and give each request a generation so late results cannot undo a refresh.
Read moreMove an app event from userInfo casts to a typed NotificationCenter message, with explicit main-actor delivery, subject filtering, and an observer lifetime you can test.
Read moreSwift 6.2 makes concurrency feel more natural for app code, but it is still easy to accidentally leave expensive work on the main actor. Here is the mental model I use for SwiftUI apps...
Read moreSwift 6 migration is easier when you turn on strict concurrency checking before flipping the language mode. Walk through a module-by-module checklist.
Read more