Integration: fix/screenstatekit-library merged and verified#1
Closed
nashysolutions wants to merge 3 commits intomainfrom
Closed
Integration: fix/screenstatekit-library merged and verified#1nashysolutions wants to merge 3 commits intomainfrom
nashysolutions wants to merge 3 commits intomainfrom
Conversation
…t animation - ScreenState: change open class Sendable to @unchecked Sendable with a doc comment stating the invariant all subclasses must maintain (fixes anthony1810#19) - CancelBag: add async-safe store(task:identifier:) that inserts synchronously within actor isolation, eliminating the TOCTOU window between registration and storage (fixes anthony1810#20) - NonIsolatedActionLocker: add doc comment explicitly marking it not thread-safe and directing users to IsolatedActionLocker for concurrent use (fixes anthony1810#21) - StateUpdatable.updateState: change default animation from .smooth to .none so state mutations from network responses are no longer animated by default; callers can opt in at the call site where animation is intentional (fixes anthony1810#22) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The protocol previously only exposed nonisolated receive(action:), which spawns an unstructured fire-and-forget task with no cancellation support. Callers in async contexts (SwiftUI .task, .refreshable) had to reach into conforming types' internal isolatedReceive method to get awaitable dispatch. Adding func send(action: Action) async makes the safe, structured path part of the public contract. receive(action:) is retained for sync contexts (button callbacks, onAppear) where awaiting is not possible (fixes anthony1810#15). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Owner
Author
|
Closing — re-opening as a cross-fork PR targeting anthony1810/ScreenStateKit:main. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This branch merges
fix/screenstatekit-libraryand exists as an integration staging ground where the ScreenStateKit changes were verified alongside all four companion Definery PRs before any individual branch is merged tomain.Changes included (from
fix/screenstatekit-library):ScreenState— changedopen class … Sendableto@unchecked Sendablewith a doc comment stating the thread-safety invariant all subclasses must uphold (closes Improve task cancellation flow & lifecycle management anthony1810/ScreenStateKit#19)CancelBag— added async-safestore(task:identifier:)that inserts synchronously within actor isolation, eliminating the TOCTOU window between task creation and storage (closes Improve Cancellation Flow, Refactor CancelBag, ScreenActionStore and Error Handling. anthony1810/ScreenStateKit#20)ActionLocker— added doc comment toNonIsolatedActionLockerexplicitly marking it not thread-safe and directing callers toIsolatedActionLockerfor concurrent use (closes Improve Cancellation Flow, Refactor CancelBag, ScreenActionStore and Error Handling. anthony1810/ScreenStateKit#21)StateUpdatable.updateState— changed default animation from.smoothto.noneso state mutations from network responses are not animated by default; callers opt in at the call site (closes Update README for 1.1.0 API changes anthony1810/ScreenStateKit#22)ScreenActionStore— addedfunc send(action: Action) asyncas the primary structured-concurrency dispatch path;receive(action:)is retained for sync contexts (closes Replace ASCII diagram with draw.io architecture diagrams anthony1810/ScreenStateKit#15)Integration verification
All changes were tested in combination with:
fix/observable-granularity—@Observablegranularity onHomeViewStatefix/task-lifecycle—CancelBag-based task lifecycle inHomeViewStorefix/view-dispatch-consistency—send(action:)adoption in SwiftUI viewsfix/shimmer-gradient—PhaseShimmerModifierreplacing Shimmer libraryResults: build ✅ · 28/28 tests ✅ · 0 SwiftLint violations ✅
Profiler comparison (
After.tracevs baseline): hitches 4 → 1, cause-graph edges 34,232 → 24,085,HomeSnapshotinvalidation cascade (11,307 edges) eliminated entirely.Test plan
store(task:identifier:)stores tasks atomically with no TOCTOU window under concurrent dispatchStateUpdatable.updateStatemutations from network calls are not animatedsend(action:)awaits the full action lifecycle and propagates cancellation correctly🤖 Generated with Claude Code