Migrate client state off ObjectBox to Radiance#8447
Conversation
|
@atavism I think this pretty big change, did we remove obejctbox completly? I thought we were just removing private server stuff.
Correct if I'm wrong, I have not looked in detail. |
|
@jigar-f Yes, I went ahead and fully removed ObjectBox in this PR. If Radiance is our source of truth for persistent state (user, selected server, split tunneling, etc.), I think we’re better off not keeping a separate Flutter DB. I get the concern about extra FFI/platform-channel calls, but we can keep the surface area small with a few get/set endpoints (and core caching) instead of duplicating state...Does that sound reasonable? |
|
For instance, we could expose getAppState / updateAppState instead of one API per field |
|
Agreed, Radiance should definitely be the source for VPN-related functionality. That said, I don’t think Radiance needs to care whether a user has a plan or not, or whether the user is shown an intro, etc. That logic can probably live elsewhere — though I don’t have a strong opinion against it. I think we should take the time to test everything thoroughly and make sure all flows are working as expected before merging. |
* Added windows build step * Added link to dev README
* Added windows build step * Added link to dev README * Fixed windows paths
* Select server location from menu bar * Improve readability and check extension status. * Merge main --------- Co-authored-by: Jigar-f <jigar@getlantern.org>
|
@atavism, sorry, I know thisis on me. I will start reviewing this soon, caught up on someother stuff. |
|
No worries, thanks @jigar-f! |
|
@atavism - is this still awaiting your review? |
* Sync private server with radiance. * Add back account updates * Added support delete server * Added split tunnling methods * Remove unused methods * Remove unused code * Add with_clash_api,with_conntrack build tags to CI tests (#8510) The Makefile already uses these tags for all production builds, but the go.yml CI workflow ran tests without them. This meant conntrack (connection tracking) was disabled in tests, so code paths like graceful connection draining were never exercised in CI. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> * remove pre-releases sooner and more thoroughly (#8506) * remove pre-releases sooner and more thoroughly * allow non-main nightlies, but cleanup the release * don't make releases for nightly builds, either * added support for ServerCredential and fixed UI issues * more update * OAuth account updates (#8513) * update delete account flow * save OAuth provider and map to delete account * Fixed some more Oauth issues * Fix issue on while signup using OAuth * use remote radiance * update IOS method channel * Update lantern_generated_bindings.dart * code review updates * More improvements * ran format * fix animaiton issue * more imporvements * fix account issue * update radiance with OAuth fix * Fix account delete dialog * Update en.po * Match last build version and number * code review updates (#8514) --------- Co-authored-by: atavism <atavism@users.noreply.github.com> * be selective on paths when running ci (#8507) * centerlize local saving logic * Remove more unused code * code review updates * ran format * update radiance * Update ffi.go * remove duplication. --------- Co-authored-by: Myles Horton <afisk@getlantern.org> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Jay <110402935+jay-418@users.noreply.github.com> Co-authored-by: atavism <atavism@users.noreply.github.com>
|
@jigar-f Did you do some testing? Lmk if/when you're comfortable merging this. Thanks! |
|
@atavism I did a bit of testing, so far it looks good. Still, I like to test a bit more payment stuff, maybe give it 2 more days. |
There was a problem hiding this comment.
Pull request overview
This PR migrates Flutter-side user/session-related state off of the local ObjectBox DB and onto Riverpod providers backed by lantern-core/Radiance APIs (with Go-side caching), while also adding new private-server and split-tunneling bridging methods across Dart ⇄ native ⇄ Go.
Changes:
- Removes ObjectBox (deps, generated plugin registrants, entities/mappers) and introduces a SharedPreferences-backed
LocalStorageServicefor lightweight cached settings. - Refactors multiple features (plans, server location selection, private servers, split tunneling, user/home) to consume Riverpod providers sourced from lantern-core instead of local DB reads.
- Adds new private-server and split-tunnel APIs across Go core, FFI exports, and native method-channel handlers.
Reviewed changes
Copilot reviewed 114 out of 119 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
pubspec.yaml / pubspec.lock |
Removes ObjectBox deps; adds shared_preferences as a direct dependency. |
lib/core/services/local_storage_service.dart |
New SharedPreferences cache wrapper replacing DB reads for settings/plans/location/dev-mode. |
lib/core/services/injection_container.dart |
Switches LocalStorageService to async GetIt singleton registration. |
lib/lantern/lantern_platform_service.dart |
Adds split-tunnel + private-server methods and enabled-apps snapshot refresh logic. |
ios/Runner/Handlers/MethodHandler.swift / android/.../MethodHandler.kt / macos/.../MethodHandler.swift |
Adds/updates method-channel plumbing for new core APIs. |
lib/features/private_server/manage_private_server.dart |
Updates private-server UI to use available servers from core and adds share-key caching. |
Comments suppressed due to low confidence (1)
ios/Runner/Handlers/MethodHandler.swift:193
- The iOS method channel only adds
deletePrivateServerByName, but Dart now callsgetSplitTunnelItems/getSplitTunnelState(and private-server rename once implemented) viaLanternPlatformService. Without adding these cases to the iOS handler, iOS will hitFlutterMethodNotImplemented/MissingPlugin errors at runtime when split-tunneling screens load. Please add the missing method cases and wire them to the newMobileGetSplitTunnelItems,MobileGetSplitTunnelStateJSON, andMobileUpdatePrivateServerName/MobileDeletePrivateServerByNameAPIs as appropriate.
case "deletePrivateServerByName":
guard let name: String = self.decodeValue(from: call.arguments, result: result) else {
return
}
self.deletePrivateServerByName(result: result, name: name)
// Server Selection
case "getLanternAvailableServers":
self.getLanternAvailableServers(result: result)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Resolves https://github.com/getlantern/engineering/issues/2944
This PR replaces Flutter local DB/local storage reads for user, plans, split-tunneling, private servers, and selected server location with Riverpod providers backed by lantern-core/Radiance APIs (with Go-side on-disk caching)