Commit d6d0f52
committed
swap EventProducer for CompletableDeferred
This change fixes a rare bug where RecoverFromDroppedLoginBug may not
run. While very rare this could happen if start was called on
OperationRepo first and it finished before
RecoverFromDroppedLoginBug.start was called.
We swapped out EventProducer for a CompletableDeferred to address this
issue. CompletableDeferred is a better fit as we simply need to wait
until something is initialized, and it will never fire more than once.
We also refactored RecoverFromDroppedLoginBugTests to account for the
change, but improved the testing to ensure the operation itself is
correct.1 parent b04a96a commit d6d0f52
File tree
6 files changed
+76
-85
lines changed- OneSignalSDK/onesignal/core/src
- main/java/com/onesignal
- core/internal/operations
- impl
- user/internal/migrations
- test/java/com/onesignal
- core/internal/operations
- user/internal/migrations
6 files changed
+76
-85
lines changedOneSignalSDK/onesignal/core/src/main/java/com/onesignal/core/internal/operations/IOperationRepo.kt
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 6 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | 3 | | |
6 | 4 | | |
7 | 5 | | |
8 | 6 | | |
9 | 7 | | |
10 | 8 | | |
11 | | - | |
12 | 9 | | |
13 | 10 | | |
14 | 11 | | |
15 | 12 | | |
16 | 13 | | |
17 | 14 | | |
| 15 | + | |
18 | 16 | | |
19 | 17 | | |
20 | 18 | | |
| |||
30 | 28 | | |
31 | 29 | | |
32 | 30 | | |
33 | | - | |
| 31 | + | |
34 | 32 | | |
35 | 33 | | |
36 | 34 | | |
| |||
52 | 50 | | |
53 | 51 | | |
54 | 52 | | |
55 | | - | |
| 53 | + | |
56 | 54 | | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
| 55 | + | |
| 56 | + | |
66 | 57 | | |
67 | 58 | | |
68 | 59 | | |
| |||
101 | 92 | | |
102 | 93 | | |
103 | 94 | | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | 95 | | |
109 | 96 | | |
110 | 97 | | |
| |||
431 | 418 | | |
432 | 419 | | |
433 | 420 | | |
434 | | - | |
| 421 | + | |
435 | 422 | | |
436 | 423 | | |
Lines changed: 16 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| |||
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
34 | | - | |
| 36 | + | |
35 | 37 | | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| |||
Lines changed: 4 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
| |||
599 | 601 | | |
600 | 602 | | |
601 | 603 | | |
602 | | - | |
| 604 | + | |
603 | 605 | | |
604 | 606 | | |
605 | | - | |
606 | 607 | | |
607 | 608 | | |
608 | | - | |
609 | 609 | | |
610 | 610 | | |
611 | 611 | | |
612 | 612 | | |
613 | 613 | | |
614 | | - | |
615 | | - | |
616 | | - | |
617 | | - | |
618 | | - | |
619 | | - | |
| 614 | + | |
620 | 615 | | |
621 | 616 | | |
622 | 617 | | |
| |||
Lines changed: 49 additions & 36 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | 3 | | |
7 | 4 | | |
8 | 5 | | |
| 6 | + | |
| 7 | + | |
9 | 8 | | |
10 | 9 | | |
| 10 | + | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| 28 | + | |
| 29 | + | |
27 | 30 | | |
28 | 31 | | |
29 | | - | |
| 32 | + | |
30 | 33 | | |
31 | 34 | | |
32 | 35 | | |
| |||
38 | 41 | | |
39 | 42 | | |
40 | 43 | | |
41 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
42 | 76 | | |
43 | 77 | | |
44 | 78 | | |
45 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
46 | 84 | | |
47 | 85 | | |
48 | 86 | | |
49 | 87 | | |
50 | 88 | | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | 89 | | |
60 | | - | |
61 | | - | |
| 90 | + | |
62 | 91 | | |
63 | 92 | | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
| 93 | + | |
68 | 94 | | |
69 | 95 | | |
70 | | - | |
| 96 | + | |
71 | 97 | | |
72 | 98 | | |
73 | 99 | | |
| |||
77 | 103 | | |
78 | 104 | | |
79 | 105 | | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
| 106 | + | |
91 | 107 | | |
92 | 108 | | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
| 109 | + | |
97 | 110 | | |
98 | 111 | | |
0 commit comments