Skip to content

Commit 409cbb8

Browse files
committed
android: remove workaround for IPN bus over-caching userprofiles post profile switch
This simplifies #797 now that tailscale/tailscale#19890 is in, addressing #797 (comment) which made me find the WatchIPNBus publishing-side bug. In bumping oss, we also got a new go.toolchain.rev, which made me find missing Makefile dependencies too (the AAR wasn't being rebuilt), so fix that too. Updates tailscale/tailscale#19889 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
1 parent 76c0e0e commit 409cbb8

5 files changed

Lines changed: 33 additions & 31 deletions

File tree

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ tailscale-test.apk: version gradle-dependencies
158158
(cd android && ./gradlew assembleApplicationTestAndroidTest)
159159
install -C ./android/build/outputs/apk/androidTest/applicationTest/android-applicationTest-androidTest.apk $@
160160

161-
tailscale.version: go.mod go.sum $(wildcard .git/HEAD)
161+
tailscale.version: go.mod go.sum go.toolchain.rev $(wildcard .git/HEAD)
162162
@bash -c "./tool/go run tailscale.com/cmd/mkversion > tailscale.version"
163163

164164
.PHONY: version
@@ -175,10 +175,10 @@ android/libs:
175175
$(GOBIN):
176176
mkdir -p $(GOBIN)
177177

178-
$(GOBIN)/gomobile: $(GOBIN)/gobind go.mod go.sum | $(GOBIN)
178+
$(GOBIN)/gomobile: $(GOBIN)/gobind go.mod go.sum go.toolchain.rev | $(GOBIN)
179179
./tool/go install golang.org/x/mobile/cmd/gomobile
180180

181-
$(GOBIN)/gobind: go.mod go.sum
181+
$(GOBIN)/gobind: go.mod go.sum go.toolchain.rev
182182
./tool/go install golang.org/x/mobile/cmd/gobind
183183

184184
.PHONY: build-unstripped-aar

android/src/main/java/com/tailscale/ipn/ui/notifier/Notifier.kt

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -181,18 +181,22 @@ object Notifier {
181181

182182
val self = notify.SelfChange
183183
if (initial == null && self != null && !next.isSameSelf(self)) {
184-
next = self.toEmptyNetworkMap(userProfiles.toMap())
184+
// A self node change is a profile boundary. It resets the implicit bus
185+
// state, so the publisher must resend any UserProfiles referenced by the
186+
// new profile. Clear before applying this Notify's UserProfiles below so
187+
// profiles included in the same update are retained.
188+
userProfiles.clear()
189+
next = self.toEmptyNetworkMap()
185190
if (BuildConfig.DEBUG) {
186191
TSLog.d(
187-
TAG, "received self change for a different node; cleared peers before applying deltas")
192+
TAG,
193+
"received self change for a different node; cleared peers and users before applying deltas")
188194
}
189195
}
190196

191197
notify.UserProfiles?.let { userProfiles.putAll(it) }
192198

193-
if (userProfiles.isNotEmpty() || next.UserProfiles.isNotEmpty()) {
194-
next = next.copy(UserProfiles = userProfiles.toMap())
195-
}
199+
next = next.copy(UserProfiles = userProfiles.toMap())
196200
if (self != null) {
197201
next =
198202
next.copy(
@@ -247,16 +251,14 @@ object Notifier {
247251

248252
private fun Tailcfg.Node.capabilities() = CapMap?.keys?.toList() ?: Capabilities.orEmpty()
249253

250-
private fun Tailcfg.Node.toEmptyNetworkMap(
251-
profiles: Map<String, Tailcfg.UserProfile>
252-
): Netmap.NetworkMap {
254+
private fun Tailcfg.Node.toEmptyNetworkMap(): Netmap.NetworkMap {
253255
val suffix = magicDNSSuffix()
254256
val self = withDisplayNames(suffix)
255257
return Netmap.NetworkMap(
256258
SelfNode = self,
257259
Peers = emptyList(),
258260
Domain = suffix,
259-
UserProfiles = profiles,
261+
UserProfiles = emptyMap(),
260262
TKAEnabled = false,
261263
DNS = null,
262264
AllCaps = self.capabilities())

go.mod

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.26.3
55
require (
66
github.com/tailscale/wireguard-go v0.0.0-20260427181203-e3ac4a0afb4e
77
golang.org/x/mobile v0.0.0-20240806205939-81131f6468ab
8-
tailscale.com v1.99.0-pre.0.20260527163023-b553969b0328
8+
tailscale.com v1.99.0-pre.0.20260527214702-c9fb05b6f512
99
)
1010

1111
require (
@@ -72,14 +72,14 @@ require (
7272
github.com/x448/float16 v0.8.4 // indirect
7373
go4.org/mem v0.0.0-20240501181205-ae6ca9944745 // indirect
7474
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba // indirect
75-
golang.org/x/crypto v0.50.0 // indirect
75+
golang.org/x/crypto v0.52.0 // indirect
7676
golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b // indirect
7777
golang.org/x/mod v0.35.0 // indirect
78-
golang.org/x/net v0.53.0 // indirect
78+
golang.org/x/net v0.55.0 // indirect
7979
golang.org/x/sync v0.20.0 // indirect
80-
golang.org/x/sys v0.43.0 // indirect
81-
golang.org/x/term v0.42.0 // indirect
82-
golang.org/x/text v0.36.0 // indirect
80+
golang.org/x/sys v0.45.0 // indirect
81+
golang.org/x/term v0.43.0 // indirect
82+
golang.org/x/text v0.37.0 // indirect
8383
golang.org/x/time v0.12.0 // indirect
8484
golang.org/x/tools v0.44.0 // indirect
8585
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 // indirect

go.sum

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@ go4.org/mem v0.0.0-20240501181205-ae6ca9944745 h1:Tl++JLUCe4sxGu8cTpDzRLd3tN7US4
196196
go4.org/mem v0.0.0-20240501181205-ae6ca9944745/go.mod h1:reUoABIJ9ikfM5sgtSF3Wushcza7+WeD01VB9Lirh3g=
197197
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba h1:0b9z3AuHCjxk0x/opv64kcgZLBseWJUpBw5I82+2U4M=
198198
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba/go.mod h1:PLyyIXexvUFg3Owu6p/WfdlivPbZJsZdgWZlrGope/Y=
199-
golang.org/x/crypto v0.50.0 h1:zO47/JPrL6vsNkINmLoo/PH1gcxpls50DNogFvB5ZGI=
200-
golang.org/x/crypto v0.50.0/go.mod h1:3muZ7vA7PBCE6xgPX7nkzzjiUq87kRItoJQM1Yo8S+Q=
199+
golang.org/x/crypto v0.52.0 h1:RMs7fP2rXdep0CftQlK8Uf+kibLm7qkCcradZWYz988=
200+
golang.org/x/crypto v0.52.0/go.mod h1:1QgfPxDqh0T2M/elOJtp9RvuR95kVjir0e6/BvEmGbc=
201201
golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b h1:M2rDM6z3Fhozi9O7NWsxAkg/yqS/lQJ6PmkyIV3YP+o=
202202
golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b/go.mod h1:3//PLf8L/X+8b4vuAfHzxeRUl04Adcb341+IGKfnqS8=
203203
golang.org/x/exp/typeparams v0.0.0-20240314144324-c7f7c6466f7f h1:phY1HzDcf18Aq9A8KkmRtY9WvOFIxN8wgfvy6Zm1DV8=
@@ -208,8 +208,8 @@ golang.org/x/mobile v0.0.0-20240806205939-81131f6468ab h1:KONOFF8Uy3b60HEzOsGnNg
208208
golang.org/x/mobile v0.0.0-20240806205939-81131f6468ab/go.mod h1:udWezQGYjqrCxz5nV321pXQTx5oGbZx+khZvFjZNOPM=
209209
golang.org/x/mod v0.35.0 h1:Ww1D637e6Pg+Zb2KrWfHQUnH2dQRLBQyAtpr/haaJeM=
210210
golang.org/x/mod v0.35.0/go.mod h1:+GwiRhIInF8wPm+4AoT6L0FA1QWAad3OMdTRx4tFYlU=
211-
golang.org/x/net v0.53.0 h1:d+qAbo5L0orcWAr0a9JweQpjXF19LMXJE8Ey7hwOdUA=
212-
golang.org/x/net v0.53.0/go.mod h1:JvMuJH7rrdiCfbeHoo3fCQU24Lf5JJwT9W3sJFulfgs=
211+
golang.org/x/net v0.55.0 h1:bcvxaJn3e1U6InsFWt1JUq1aSjnRxLzT2rtD2KfkDF8=
212+
golang.org/x/net v0.55.0/go.mod h1:L5U2KuzuOe1lY7Z+aWVIKK6qEeJXnXV9yzGA+WCHJww=
213213
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
214214
golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4=
215215
golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
@@ -219,12 +219,12 @@ golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBc
219219
golang.org/x/sys v0.0.0-20220817070843-5a390386f1f2/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
220220
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
221221
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
222-
golang.org/x/sys v0.43.0 h1:Rlag2XtaFTxp19wS8MXlJwTvoh8ArU6ezoyFsMyCTNI=
223-
golang.org/x/sys v0.43.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
224-
golang.org/x/term v0.42.0 h1:UiKe+zDFmJobeJ5ggPwOshJIVt6/Ft0rcfrXZDLWAWY=
225-
golang.org/x/term v0.42.0/go.mod h1:Dq/D+snpsbazcBG5+F9Q1n2rXV8Ma+71xEjTRufARgY=
226-
golang.org/x/text v0.36.0 h1:JfKh3XmcRPqZPKevfXVpI1wXPTqbkE5f7JA92a55Yxg=
227-
golang.org/x/text v0.36.0/go.mod h1:NIdBknypM8iqVmPiuco0Dh6P5Jcdk8lJL0CUebqK164=
222+
golang.org/x/sys v0.45.0 h1:dO4czNzziLiiXplLQgBCEpCvXQ3dnkn0SdaZSYdQ+FY=
223+
golang.org/x/sys v0.45.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
224+
golang.org/x/term v0.43.0 h1:S4RLU2sB31O/NCl+zFN9Aru9A/Cq2aqKpTZJ6B+DwT4=
225+
golang.org/x/term v0.43.0/go.mod h1:lrhlHNdQJHO+1qVYiHfFKVuVioJIheAc3fBSMFYEIsk=
226+
golang.org/x/text v0.37.0 h1:Cqjiwd9eSg8e0QAkyCaQTNHFIIzWtidPahFWR83rTrc=
227+
golang.org/x/text v0.37.0/go.mod h1:a5sjxXGs9hsn/AJVwuElvCAo9v8QYLzvavO5z2PiM38=
228228
golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE=
229229
golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg=
230230
golang.org/x/tools v0.44.0 h1:UP4ajHPIcuMjT1GqzDWRlalUEoY+uzoZKnhOjbIPD2c=
@@ -247,5 +247,5 @@ howett.net/plist v1.0.0 h1:7CrbWYbPPO/PyNy38b2EB/+gYbjCe2DXBxgtOOZbSQM=
247247
howett.net/plist v1.0.0/go.mod h1:lqaXoTrLY4hg8tnEzNru53gicrbv7rrk+2xJA/7hw9g=
248248
software.sslmate.com/src/go-pkcs12 v0.4.0 h1:H2g08FrTvSFKUj+D309j1DPfk5APnIdAQAB8aEykJ5k=
249249
software.sslmate.com/src/go-pkcs12 v0.4.0/go.mod h1:Qiz0EyvDRJjjxGyUQa2cCNZn/wMyzrRJ/qcDXOQazLI=
250-
tailscale.com v1.99.0-pre.0.20260527163023-b553969b0328 h1:xJTociQgVsuL96HjAmsKDvksUR/FAYO8WNrbrZ4/zLU=
251-
tailscale.com v1.99.0-pre.0.20260527163023-b553969b0328/go.mod h1:KC8K/pFexqu48bsX/gxZVlqFg84QSkvTQSHkpN7XkUA=
250+
tailscale.com v1.99.0-pre.0.20260527214702-c9fb05b6f512 h1:w5gzgg0irMdcD9gWCsIJ5Fu9aDB7nOhSflbG564MIe0=
251+
tailscale.com v1.99.0-pre.0.20260527214702-c9fb05b6f512/go.mod h1:A1OPeOKlJEH8LdzOjlHRovMj5joxqlF1lgbzR3mbaSs=

go.toolchain.rev

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
e877d973840c91ec9d4bc1921b0845789de359ae
1+
7104161f96b07474ce312ea116c8b2a1efe1311a

0 commit comments

Comments
 (0)