Commit d53db6e
fix(iv): restore logout unsubscribe-on-OLD-user behavior
Revert the order swap from dc93995 — that commit reordered switchUserIv
to switch users first and then set isDisabledInternally on the new push
sub with NO_PROPOGATE, on the bot review's claim that firing an
UpdateSubscriptionOperation against the OLD user was a bug. It is not a
bug — it is the intentional behavior in reference branches #2599 and
#2613: setting the flag on the CURRENT push sub with the default NORMAL
tag fires an UpdateSubscriptionOperation that tells the backend "this
device is unsubscribing as the user logs out", dispatched with the OLD
user's still-valid JWT before the switch. Without this, logout under IV
silently leaves the just-departed user's push sub subscribed
server-side.
The new (anonymous) user's model not carrying isDisabledInternally is
fine: anon ops are filtered by hasValidJwtIfRequired (externalId=null
under IV-active), so they accumulate but never dispatch.
Update the test to verify the corrected order.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 6360d74 commit d53db6e
2 files changed
Lines changed: 22 additions & 31 deletions
File tree
- OneSignalSDK/onesignal/core/src
- main/java/com/onesignal/user/internal
- test/java/com/onesignal/user/internal
Lines changed: 13 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | 3 | | |
5 | | - | |
6 | 4 | | |
7 | 5 | | |
8 | 6 | | |
| |||
15 | 13 | | |
16 | 14 | | |
17 | 15 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
33 | 27 | | |
34 | 28 | | |
35 | 29 | | |
| |||
42 | 36 | | |
43 | 37 | | |
44 | 38 | | |
45 | | - | |
46 | 39 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
| 40 | + | |
52 | 41 | | |
| 42 | + | |
53 | 43 | | |
54 | 44 | | |
Lines changed: 9 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
199 | | - | |
| 199 | + | |
200 | 200 | | |
201 | 201 | | |
202 | | - | |
| 202 | + | |
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
208 | | - | |
| 208 | + | |
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
| |||
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
219 | | - | |
220 | | - | |
221 | | - | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
222 | 223 | | |
223 | | - | |
224 | 224 | | |
| 225 | + | |
225 | 226 | | |
226 | 227 | | |
227 | 228 | | |
228 | | - | |
| 229 | + | |
229 | 230 | | |
230 | 231 | | |
231 | 232 | | |
| |||
0 commit comments