Commit d120b52
committed
Don't manually remove the push subscription
* When the SDK hydrates users, it will trigger the subscription model store's `replaceAll` method. This will remove the current push subscription model and immediately add a new push subscription model. The Subscription Manager was removing the current push subscription and then adding a new push subscription that it manages. When the new one is added, the old one is removed and any observers are transferred over.
* However, because the old one was already removed by the time the new one is added, observers are lost. The [onModelAdded] already triggers an add and remove, so we should not remove in the [onModelRemoved] event.
* These 2 events are always together. There is no current usage where only [onModelRemoved] is called for a push subscription model. Even on 404s, push subscription models are not removed.1 parent 8f470c0 commit d120b52
File tree
1 file changed
+8
-0
lines changed- OneSignalSDK/onesignal/core/src/main/java/com/onesignal/user/internal/subscriptions/impl
1 file changed
+8
-0
lines changedLines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
193 | 201 | | |
194 | 202 | | |
195 | 203 | | |
| |||
0 commit comments