Preserve native shopping context and isolate streaming card updates - #18
Merged
Merged
Conversation
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.
Catalog searches, product details and transaction refreshes previously shared too much lifetime. A late detail response could reopen a dismissed product, while navigating to the assistant lost the selected SKU. Both native clients now cancel superseded requests, preserve the consultation return context and catalog state, and poll an existing reservation only while its screen is visible in the foreground. An accepted write followed by a failed refresh is reported separately from an unconfirmed write.
SwiftUI gives immutable message segments their own equality boundary so text growth can reuse unchanged cards. Finalization and same-slot replacements still update native controls. Card presence crosses the Kotlin/Swift boundary as a Boolean; content uses the existing JSON string representation. Release builds select the Release Kotlin/Native framework.
Validation:
78d612a0dce4e53a3f545f84f70496ec6960cf9eto final7df07c6ba7a4f14b9ca74869ddd33e79991f2df5: mean elapsed 5.369 to 5.380 seconds, process CPU 1.777 to 1.848 seconds, peak physical memory 139114 to 111965 kB. CPU and elapsed time did not improve; the lower memory observation is local to this workload, not a frame-rate or general speed claim.The catalog test uses SwiftUI ID navigation, actual content offset and screenshots; it does not claim physical touch or OS suspension coverage. Mixed replay uses URLProtocol, without TCP/TLS, model or business service. Measurements include history restore, native byte handling, KMP, SwiftUI, completion polling and final image capture. Fixed pacing dominates elapsed time. SwiftUI Instruments is unavailable on Simulator, and a separate Time Profiler capture failed to finish; neither provides frame or call-count evidence.
The new card-state regression caught a Debug-only nested Kotlin JSON bridging crash in the initial instrumentation guard. It was fixed using the scalar presence getter; the complete suite and final Release replay were rerun. Raw XCTest outputs and screenshots were retained, without discarding unsuccessful diagnostics.