Skip to content

Commit 7794eaa

Browse files
atavismmyleshortonclaudejigar-f
authored
Tighten isTagAvailable handling (#8572)
* Update radiance + lantern-box for bandit distributed tracing (#8566) - radiance: picks up lantern-box v0.0.51 - lantern-box v0.0.51: propagates traceparent from bandit callback URLs, enabling contiguous distributed tracing across the feedback loop Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * System tray changes (#8568) * added back sys tray changes * server location changes * add flags only on desktop versions. * code review updates (#8569) * Update lantern_platform_service.dart --------- Co-authored-by: atavism <atavism@users.noreply.github.com> * Update radiance with bandit callback fixes (#8570) Picks up: - Pre-test uses live network config (not stale disk config) - updateGroup fires SetURLOverrides + CheckOutbounds on repeat configs - Pre-test timeout 5s → 15s for proxy callback tests Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * code review updates --------- Co-authored-by: Myles Horton <afisk@getlantern.org> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: jigar-f <132374182+jigar-f@users.noreply.github.com>
1 parent 32c999c commit 7794eaa

21 files changed

Lines changed: 414 additions & 263 deletions

android/app/src/main/kotlin/org/getlantern/lantern/handler/MethodHandler.kt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,14 +198,17 @@ class MethodHandler : FlutterPlugin,
198198

199199
Methods.IsTagAvailable.method -> {
200200
scope.launch {
201-
runCatching {
202-
val tag = call.arguments as String? ?: ""
201+
try {
202+
val tag = call.arguments as? String
203+
?: throw IllegalArgumentException("Missing or invalid tag")
203204
val available = Mobile.isTagAvailable(tag)
204205
withContext(Dispatchers.Main) {
205206
result.success(available)
206207
}
207-
}.onFailure { e ->
208-
result.error("tag_check_failed", e.localizedMessage ?: "Error", e)
208+
} catch (e: Throwable) {
209+
withContext(Dispatchers.Main) {
210+
result.error("tag_check_failed", e.localizedMessage ?: "Error", e)
211+
}
209212
}
210213
}
211214
}

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ require (
2525
github.com/alecthomas/assert/v2 v2.3.0
2626
github.com/getlantern/common v1.2.1-0.20260224184656-5aefb9c21c85
2727
github.com/getlantern/lantern-server-provisioner v0.0.0-20251031121934-8ea031fccfa9
28-
github.com/getlantern/radiance v0.0.0-20260323184750-279e5efda556
28+
github.com/getlantern/radiance v0.0.0-20260324154403-6c425327102b
2929
github.com/sagernet/sing-box v1.12.22
3030
golang.org/x/mobile v0.0.0-20250711185624-d5bb5ecc55c0
3131
golang.org/x/sys v0.41.0
@@ -172,7 +172,7 @@ require (
172172
github.com/getlantern/fronted v0.0.0-20260319225233-cf2160f85053 // indirect
173173
github.com/getlantern/keepcurrent v0.0.0-20260304213122-017d542145ae // indirect
174174
github.com/getlantern/kindling v0.0.0-20260319225424-4736208dd171 // indirect
175-
github.com/getlantern/lantern-box v0.0.50 // indirect
175+
github.com/getlantern/lantern-box v0.0.51 // indirect
176176
github.com/getlantern/lantern-water v0.0.0-20260317143726-e0ee64a11d90 // indirect
177177
github.com/getlantern/osversion v0.0.0-20240418205916-2e84a4a4e175 // indirect
178178
github.com/getlantern/pluriconfig v0.0.0-20251126214241-8cc8bc561535 // indirect

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,8 @@ github.com/getlantern/keepcurrent v0.0.0-20260304213122-017d542145ae h1:NMq3K7h3
247247
github.com/getlantern/keepcurrent v0.0.0-20260304213122-017d542145ae/go.mod h1:ag5g9aWUw2FJcX5RVRpJ9EBQBy5yJuy2WXDouIn/m4w=
248248
github.com/getlantern/kindling v0.0.0-20260319225424-4736208dd171 h1:UEjX+Gg+T6oGVUbzHJ4JfLhlsIh8Wl8PmTXZYWGS43A=
249249
github.com/getlantern/kindling v0.0.0-20260319225424-4736208dd171/go.mod h1:c5cFjpNrqX8wQ0PUE2blHrO7knAlRCVx3j1/G6zaVlY=
250-
github.com/getlantern/lantern-box v0.0.50 h1:WKmw56+IClysCIg6VB7P4Hti1Vc7tEC405xbV6I7dwA=
251-
github.com/getlantern/lantern-box v0.0.50/go.mod h1:Luj0rLyuokADHg2B+eXlAdxVXYO+T5Reeds+hKuQkZA=
250+
github.com/getlantern/lantern-box v0.0.51 h1:ahneSAcd75m8jHqx9k85dghmboEhLp6NpjMtp1/zBcM=
251+
github.com/getlantern/lantern-box v0.0.51/go.mod h1:Luj0rLyuokADHg2B+eXlAdxVXYO+T5Reeds+hKuQkZA=
252252
github.com/getlantern/lantern-server-provisioner v0.0.0-20251031121934-8ea031fccfa9 h1:6seyD2f9tz2am0YQd/Qn+q7LFiiQgnmxgwWFnVceGZw=
253253
github.com/getlantern/lantern-server-provisioner v0.0.0-20251031121934-8ea031fccfa9/go.mod h1:s0VKrlJf/z+M0U8IKHFL2hfuflocRw3SINmMacrTlMA=
254254
github.com/getlantern/lantern-water v0.0.0-20260317143726-e0ee64a11d90 h1:P9JX1yAu2uq3b5YiT0sLtHkTrkZuttV8gPZh81nUuag=
@@ -259,8 +259,8 @@ github.com/getlantern/osversion v0.0.0-20240418205916-2e84a4a4e175 h1:JWH5BB2o0e
259259
github.com/getlantern/osversion v0.0.0-20240418205916-2e84a4a4e175/go.mod h1:h3S9LBmmzN/xM+lwYZHE4abzTtCTtidKtG+nxZcCZX0=
260260
github.com/getlantern/pluriconfig v0.0.0-20251126214241-8cc8bc561535 h1:rtDmW8YLAuT8r51ApR5z0d8/qjhHu3TW+divQ2C98Ac=
261261
github.com/getlantern/pluriconfig v0.0.0-20251126214241-8cc8bc561535/go.mod h1:WKJEdjMOD4IuTRYwjQHjT4bmqDl5J82RShMLxPAvi0Q=
262-
github.com/getlantern/radiance v0.0.0-20260323184750-279e5efda556 h1:Az3xs4Hf9+ocTgztidJmomFsh53+c/CSdPupvTm2oJc=
263-
github.com/getlantern/radiance v0.0.0-20260323184750-279e5efda556/go.mod h1:mKokYt24akTTI1LR4n6LT4C57lL+j0C97q3vQljpX8o=
262+
github.com/getlantern/radiance v0.0.0-20260324154403-6c425327102b h1:Rl7D7DjBDxz1p+u9f53MavQFQabh4rdbhMA5aWRARr8=
263+
github.com/getlantern/radiance v0.0.0-20260324154403-6c425327102b/go.mod h1:bqqrKshKfTPIEOjsedL9p1N5bZBRYTZ2UeUZMtgFWWY=
264264
github.com/getlantern/samizdat v0.0.3-0.20260310125445-325cf1bd1b60 h1:m9eXjDK9vllbVH467+QXbrxUFFM9Yp7YJ90wZLw4dwU=
265265
github.com/getlantern/samizdat v0.0.3-0.20260310125445-325cf1bd1b60/go.mod h1:uEeykQSW2/6rTjfPlj3MTTo59poSHXfAHTGgzYDkbr0=
266266
github.com/getlantern/sing v0.7.18-lantern h1:QKGgIUA3LwmKYP/7JlQTRkxj9jnP4cX2Q/B+nd8XEjo=

ios/Runner/Handlers/MethodHandler.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ class MethodHandler {
3333
self.startVPN(result: result)
3434

3535
case "isTagAvailable":
36-
guard let tag = call.arguments as? String else {
37-
result(true)
36+
guard let tag: String = self.decodeValue(from: call.arguments, result: result) else {
3837
return
3938
}
4039
self.isTagAvailable(result: result, tag: tag)

lib/features/home/home.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,9 @@ class _HomeState extends ConsumerState<Home> {
145145
}
146146

147147
Widget _buildBody(WidgetRef ref, bool isUserPro) {
148-
final serverLocationAsync = ref.watch(serverLocationProvider);
148+
final serverLocation = ref.watch(serverLocationProvider);
149149

150-
// Choose a safe default while loading/error
151-
final serverLocation = serverLocationAsync.value;
152-
final serverType = (serverLocation?.serverType ?? '').toServerLocationType;
150+
final serverType = serverLocation.serverType.toServerLocationType;
153151

154152
return Padding(
155153
padding: EdgeInsets.symmetric(horizontal: defaultSize),

lib/features/home/provider/home_notifier.dart

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -97,20 +97,14 @@ class HomeNotifier extends _$HomeNotifier {
9797
/// if user logs out or downgrade to free plan
9898
/// we need to reset the server location set to smart location
9999
void resetServerLocation() {
100-
final serverLocationAsync = ref.read(serverLocationProvider);
100+
final serverLocation = ref.read(serverLocationProvider);
101101

102-
serverLocationAsync.when(
103-
data: (serverLocation) {
104-
if (serverLocation.serverType.toServerLocationType ==
105-
ServerLocationType.lanternLocation) {
106-
ref
107-
.read(serverLocationProvider.notifier)
108-
.updateServerLocation(initialServerLocation());
109-
}
110-
},
111-
loading: () {},
112-
error: (_, __) {},
113-
);
102+
if (serverLocation.serverType.toServerLocationType ==
103+
ServerLocationType.lanternLocation) {
104+
ref
105+
.read(serverLocationProvider.notifier)
106+
.updateServerLocation(initialServerLocation());
107+
}
114108
}
115109

116110
/// Fetches the latest user data from the server if not cached locally.

0 commit comments

Comments
 (0)