Task.detached Isn't Task With Extra Steps. It Throws Away Everything Task Inherited For You.
Task.detached in Swift concurrency looks like a stronger version of Task, but it silently drops actor isolation, priority, and task-local values. Here's what actually breaks, and when detached is genuinely the right call.
An Actor Isn't a Lock. It's a Line With a Very Specific Rule About Cutting.
Swift actors guarantee that only one task touches their state at a time — except across every await, where a second task can walk right in. Here's what actor reentrancy actually means and the bug pattern it causes.
Your defer Didn't Fire Late. It Fired Exactly on Time — Just Not the Time You Meant
Swift's defer runs at the end of the enclosing scope, not the end of the function. Inside an if/else branch, that difference can silently defeat the cleanup you thought you wrote.
The Actor That Refreshes Your Token Perfectly. It Also Forgets It on Relaunch.
AuthTokenStore solved the token-refresh race condition with a Swift actor. What it never solved is where the token lives between launches. Here's why an in-memory actor isn't secure storage, and what a Keychain-backed version actually costs you.
Retry, Token Refresh, and Request Deduplication in Swift
Day 23 of the 30-day iOS series. The three production concerns every 'build your own networking layer' tutorial skips, built as composable actors on top of Day 22's client — plus a real concurrency bug I found writing the test, not the code.