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 97–108 of 200 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 moreLet URLSession revalidate a JSON response with ETag, understand what a 304 actually saves, and test server requests separately from decoded app results.
Read moreTwo Swift strings can compare equal while containing different UTF-8 bytes. Match your identifier type to the server contract before using it as a dictionary or SwiftUI identity.
Read moreBuild a calendar-based streak calculation that handles short days, long days, duplicate completions, and an unfinished today without adding a server-side counter.
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 moreBuild native swipe actions outside List with swipeActionsContainer, stable row identity, item-based deletion confirmation, and an accessible menu fallback.
Read moreUse named SwiftUI previews, seeded debug states, simctl screenshots, temporary tuning controls, and narrow snapshot checks to make agent-assisted UI work repeatable instead of vibes-based.
Read moreUse SwiftUI layer effects, stitchable Metal shaders, TimelineView, maxSampleOffset, and transcript layout state to build a now-playing screen that still has production boundaries.
Read moreBuild a small agentic SwiftUI feature, profile it with the Foundation Models Instrument, and use the trace to fix prompt bloat, repeated tool calls, latency, and unsafe debugging data.
Read more