Release v2.1.1 — Compose Module, Hardened Concurrency & ProGuard-safe Persistence#3
Merged
Merged
Conversation
… Persistence ## What's new - krelay-compose: KRelayEffect<T> and rememberKRelayImpl<T> extracted to a standalone artifact (dev.brewkits:krelay-compose:2.1.1) with full Maven Central compliance (POM, signing, javadoc jar) - assets/logo.svg: new brand logo matching the brewkits library family style ## Concurrency & correctness - Atomic dispatch: impl lookup + queue insertion + persistence decision all happen inside a single lock, closing the TOCTOU window that could strand an action indefinitely - I/O outside lock: persistence save/remove called after releasing the lock so disk latency never blocks the dispatch path - Identity-aware unregister: unregister(impl) only removes registration if the stored WeakRef points to the same object, preventing a recomposing Compose component from clearing a newer registration - Thread-safe KRelayMetrics: all record*/get* operations are lock-protected ## API improvements - KRelay.unregister<T>(impl: T? = null): identity-safe overload added to singleton API (consistent with KRelayInstance extension) - ProGuard/R8-safe persistence: registerActionFactory and dispatchPersisted now require an explicit featureKey string; old overloads deprecated with replaceWith guidance - getMetricsInternal: now returns live KRelayMetrics data (was emptyMap()) ## iOS - registerFeature validates interface conformance at runtime; crashes in debug mode, logs a clear warning in release - KRelayKClassHelpers.kt added to iosMain for Swift KClass bridging - KRelayIosHelper: removed duplicate getKClassForType function ## Bug fixes - VoyagerDemo: navImpl hoisted into remember(navigator) to prevent K/N GC collecting it between registration and first dispatch - COMPOSE_INTEGRATION.md: fixed 5 code examples with the same GC bug (impl created inside DisposableEffect setup block, not held by remember) - KRelayBuilder: removed (v2.0.1) inline version annotations ## Docs - README rewritten: modern structure, accurate What's New, persistent dispatch and scope tokens showcased, no false claims about actionExpiryMs change - CHANGELOG 2.1.1 entry corrected and expanded - RELEASE_NOTES_2.1.1.md corrected (removed wrong "1 min expiry" claim) ## CI - workflow updated: triggers on feature/**, fix/**, release/** branches - krelay-compose build added to build job - composeApp iOS framework link added to build job - publish-snapshot now publishes both krelay and krelay-compose ## Tests - RegistryBehaviorTest (new): identity-aware unregister, same-class replacement, KRelay.getMetrics<T>() live data, metrics disabled, instance isolation Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
krelay-composemodule:KRelayEffect<T>andrememberKRelayImpl<T>extracted to a standalone artifact (dev.brewkits:krelay-compose:2.1.1) with full Maven Central complianceunregister:unregister(impl)only clears if the stored ref matches, preventing Compose recomposition from wiping a newer registrationregisterActionFactory/dispatchPersistednow require an explicitfeatureKeystring; old overloads deprecatedKRelayMetrics: all operations lock-protectedregisterFeaturevalidates interface conformance at runtimenavImplhoisted intoremember(navigator)to prevent K/N GC collecting it before first dispatchfeature/**branches;krelay-composeadded to build and publish pipelineRegistryBehaviorTestadded (identity unregister, same-class replacement, live metrics)assets/logo.svgaddedTest plan
./gradlew :krelay:test— all unit tests pass./gradlew :krelay:linkDebugFrameworkIosSimulatorArm64— iOS framework builds./gradlew :composeApp:assembleDebug— Android demo builds