KMP SDK: Improve Robustness of Access Point Feature#781
Merged
tcamise-gpsw merged 10 commits intomainfrom Jun 18, 2025
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the robustness of the Access Point and COHN features by introducing state flows, retry logic, and better error handling, and updates JVM targets to Java 17 across modules.
- Introduce
MutableStateFlow/StateFlowfor bothCohnFeatureandAccessPointFeatureto track feature state. - Add retry (
robustlyConnect) and timeout logic for AP connections, and streamline COHN provisioning flows. - Refactor
GoProFacadeto surface feature state directly, remove outdated descriptor manager, and bump JVM compatibility to 17.
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| demos/kotlin/kmp_sdk/wsdk/src/commonMain/kotlin/com/gopro/open_gopro/gopro/features/CohnFeature.kt | Added state flow, private getState(), certificate handling, and BLE-availability loop |
| demos/kotlin/kmp_sdk/wsdk/src/commonMain/kotlin/com/gopro/open_gopro/gopro/features/AccessPointFeature.kt | Added state flow, robustlyConnect, retry/timeout logic, and disconnect helper |
| demos/kotlin/kmp_sdk/wsdk/src/commonMain/kotlin/com/gopro/open_gopro/gopro/GoProFacade.kt | Removed custom descriptor manager, wired feature state properties |
| demos/kotlin/kmp_sdk/wsdk/src/commonMain/kotlin/com/gopro/open_gopro/gopro/FeaturesContainer.kt | Updated FeatureContext to include CoroutineScope |
| build.gradle.kts files (wsdk, simplifiedApp, composeApp) | Bumped jvmTarget and source/target compatibility to Java 17 |
| demos/kotlin/kmp_sdk/simplifiedApp/src/commonMain/kotlin/App.kt | Updated example to match new AP connect API |
| demos/kotlin/kmp_sdk/gradle/libs.versions.toml | Adjusted Compose and tooling preview versions |
| demos/kotlin/kmp_sdk/docs/sdk_documentation.md | Corrected typo in example and aligned with new API |
| demos/kotlin/kmp_sdk/composeApp/src/commonMain/kotlin/ui/screens/connected/AccessPointScreen.kt | Added error snackbar and disconnect button UI |
| demos/kotlin/kmp_sdk/composeApp/src/commonMain/kotlin/presenter/AccessPointViewModel.kt | Added error state, unified state setter, and disconnect handling |
...kmp_sdk/wsdk/src/commonMain/kotlin/com/gopro/open_gopro/gopro/features/AccessPointFeature.kt
Outdated
Show resolved
Hide resolved
...kotlin/kmp_sdk/wsdk/src/commonMain/kotlin/com/gopro/open_gopro/gopro/features/CohnFeature.kt
Show resolved
Hide resolved
...kmp_sdk/wsdk/src/commonMain/kotlin/com/gopro/open_gopro/gopro/features/AccessPointFeature.kt
Outdated
Show resolved
Hide resolved
...kotlin/kmp_sdk/wsdk/src/commonMain/kotlin/com/gopro/open_gopro/gopro/features/CohnFeature.kt
Show resolved
Hide resolved
demos/kotlin/kmp_sdk/composeApp/src/commonMain/kotlin/ui/screens/connected/AccessPointScreen.kt
Outdated
Show resolved
Hide resolved
tcamise-gpsw
added a commit
that referenced
this pull request
Jun 18, 2025
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.
This pull request includes several updates to improve the Kotlin multiplatform SDK, with key changes to upgrade the JVM target, enhance the
AccessPointViewModelfunctionality, and refactor theGoProFacadeclass. Additionally, it introduces UI updates for better error handling and disconnect functionality, and includes dependency updates.JVM Target Upgrade:
JVM_11toJVM_17across multiplebuild.gradle.ktsfiles for better compatibility and performance. ([[1]](https://github.com/gopro/OpenGoPro/pull/781/files#diff-e81b6236410e18cd23afb3d71adabdf1ab5263f6f7f7b6c3b751a787905eed1bL19-R19),[[2]](https://github.com/gopro/OpenGoPro/pull/781/files#diff-e81b6236410e18cd23afb3d71adabdf1ab5263f6f7f7b6c3b751a787905eed1bL111-R112),Fe759893L5R5,[[3]](https://github.com/gopro/OpenGoPro/pull/781/files#diff-110d05125eb6cdef18fba6341e5cc233f92dfcbb200bad745759f5de17acdb82L50-R51),[[4]](https://github.com/gopro/OpenGoPro/pull/781/files#diff-f41a7d41a620239b3d83dab813444e79bfb42849affd5df3ee5ce7ee06af91d9L24-R23),[[5]](https://github.com/gopro/OpenGoPro/pull/781/files#diff-f41a7d41a620239b3d83dab813444e79bfb42849affd5df3ee5ce7ee06af91d9L112-R111))ViewModel Enhancements:
_errorMessageandsetErrorMessagefor improved error handling inAccessPointViewModel. ([demos/kotlin/kmp_sdk/composeApp/src/commonMain/kotlin/presenter/AccessPointViewModel.ktR35-R110](https://github.com/gopro/OpenGoPro/pull/781/files#diff-0b0ad7c418548276414f4ac51508cf5e3861c06d820e4b7d625c14ca1a1f038fR35-R110))setStatefor better encapsulation. ([demos/kotlin/kmp_sdk/composeApp/src/commonMain/kotlin/presenter/AccessPointViewModel.ktR35-R110](https://github.com/gopro/OpenGoPro/pull/781/files#diff-0b0ad7c418548276414f4ac51508cf5e3861c06d820e4b7d625c14ca1a1f038fR35-R110))disconnectmethod and updatedscanForSsidsandconnectToSsidmethods to use the new state management approach. ([demos/kotlin/kmp_sdk/composeApp/src/commonMain/kotlin/presenter/AccessPointViewModel.ktR35-R110](https://github.com/gopro/OpenGoPro/pull/781/files#diff-0b0ad7c418548276414f4ac51508cf5e3861c06d820e4b7d625c14ca1a1f038fR35-R110))UI Updates:
SnackbarMessageHandlerto display error messages inAccessPointScreen. ([demos/kotlin/kmp_sdk/composeApp/src/commonMain/kotlin/ui/screens/connected/AccessPointScreen.ktR43-R49](https://github.com/gopro/OpenGoPro/pull/781/files#diff-7c4ffd2eea7dd10eb02354b6813b92b5f07547ff0cf66e0f2f1dca0de2e6b8e4R43-R49))ScanScreenfor better user control. ([[1]](https://github.com/gopro/OpenGoPro/pull/781/files#diff-7c4ffd2eea7dd10eb02354b6813b92b5f07547ff0cf66e0f2f1dca0de2e6b8e4L64-R78),[[2]](https://github.com/gopro/OpenGoPro/pull/781/files#diff-7c4ffd2eea7dd10eb02354b6813b92b5f07547ff0cf66e0f2f1dca0de2e6b8e4R100-R104))Refactor of
GoProFacade:GpDescriptorManagerand refactoredaccessPointStateandcohnStateto directly use feature states. ([[1]](https://github.com/gopro/OpenGoPro/pull/781/files#diff-6a41897cd99e32876d9d1e713d2e777bccc442a7074a3c1ed7ada85321552e6aL65-L74),[[2]](https://github.com/gopro/OpenGoPro/pull/781/files#diff-6a41897cd99e32876d9d1e713d2e777bccc442a7074a3c1ed7ada85321552e6aL88-R78),[[3]](https://github.com/gopro/OpenGoPro/pull/781/files#diff-6a41897cd99e32876d9d1e713d2e777bccc442a7074a3c1ed7ada85321552e6aL108-R98))FeaturesContainer. ([demos/kotlin/kmp_sdk/wsdk/src/commonMain/kotlin/com/gopro/open_gopro/gopro/GoProFacade.ktL88-R78](https://github.com/gopro/OpenGoPro/pull/781/files#diff-6a41897cd99e32876d9d1e713d2e777bccc442a7074a3c1ed7ada85321552e6aL88-R78))Dependency and Documentation Updates:
libs.versions.toml, includinguiToolingPreviewandnavigationCompose. ([[1]](https://github.com/gopro/OpenGoPro/pull/781/files#diff-bc2be05eb27c7f962b622a9e0d672ad25fb5c319ce5058caa2c07b7593b2b953L14-R14),[[2]](https://github.com/gopro/OpenGoPro/pull/781/files#diff-bc2be05eb27c7f962b622a9e0d672ad25fb5c319ce5058caa2c07b7593b2b953L36-R36))[[1]](https://github.com/gopro/OpenGoPro/pull/781/files#diff-f450cb1277a78f22267d58032ed4c6d9eb1292481951734a2125f1ddaceefd6cL214-R217),[[2]](https://github.com/gopro/OpenGoPro/pull/781/files#diff-fc930ee7cab98738253e3a5724cae115d88c04772ac394815ff01d4df1648013L80-R82))