Commit 1887f4f
Guilherme Souza
fix(realtime): auto reconnect after calling disconnect, and several refactors (supabase#627)
* fix: trigger socket reconnection on a new Task
* use factory function for returning ws connection
* code format
* use FakeWebSocket on tests
* integration tests
* fix FakeWebSocket
* add docs for EventEmitter
* use SupabaseClient for integration test
* fire channel rejoins on background
* allow multiple channels to the same topic
* remove Socket abstraction and use client directly
* skip linux CI
* fix build1 parent bb0a89b commit 1887f4f
File tree
15 files changed
+1043
-742
lines changed- .github/workflows
- Sources
- Helpers
- Realtime
- V2
- WebSocket
- Tests
- IntegrationTests
- RealtimeTests
15 files changed
+1043
-742
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
| 95 | + | |
99 | 96 | | |
100 | 97 | | |
101 | 98 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
11 | 14 | | |
12 | 15 | | |
13 | 16 | | |
| |||
44 | 47 | | |
45 | 48 | | |
46 | 49 | | |
47 | | - | |
48 | 50 | | |
49 | | - | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| |||
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
62 | | - | |
63 | | - | |
64 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
65 | 72 | | |
66 | 73 | | |
67 | 74 | | |
68 | 75 | | |
69 | 76 | | |
70 | 77 | | |
71 | 78 | | |
72 | | - | |
| 79 | + | |
73 | 80 | | |
74 | 81 | | |
75 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
76 | 86 | | |
77 | 87 | | |
78 | 88 | | |
| |||
84 | 94 | | |
85 | 95 | | |
86 | 96 | | |
87 | | - | |
88 | | - | |
| 97 | + | |
| 98 | + | |
89 | 99 | | |
90 | 100 | | |
91 | 101 | | |
92 | | - | |
93 | | - | |
| 102 | + | |
| 103 | + | |
94 | 104 | | |
95 | 105 | | |
96 | 106 | | |
97 | 107 | | |
98 | 108 | | |
| 109 | + | |
99 | 110 | | |
100 | | - | |
101 | | - | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
102 | 115 | | |
103 | 116 | | |
104 | 117 | | |
| |||
109 | 122 | | |
110 | 123 | | |
111 | 124 | | |
| 125 | + | |
112 | 126 | | |
113 | 127 | | |
114 | 128 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
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 | 28 | | |
69 | 29 | | |
70 | 30 | | |
| |||
77 | 37 | | |
78 | 38 | | |
79 | 39 | | |
80 | | - | |
| 40 | + | |
| 41 | + | |
81 | 42 | | |
82 | 43 | | |
83 | 44 | | |
| |||
105 | 66 | | |
106 | 67 | | |
107 | 68 | | |
108 | | - | |
| 69 | + | |
109 | 70 | | |
110 | 71 | | |
111 | 72 | | |
| |||
120 | 81 | | |
121 | 82 | | |
122 | 83 | | |
123 | | - | |
124 | | - | |
| 84 | + | |
| 85 | + | |
125 | 86 | | |
126 | 87 | | |
127 | 88 | | |
| |||
130 | 91 | | |
131 | 92 | | |
132 | 93 | | |
133 | | - | |
134 | | - | |
135 | 94 | | |
136 | 95 | | |
137 | 96 | | |
| |||
144 | 103 | | |
145 | 104 | | |
146 | 105 | | |
147 | | - | |
| 106 | + | |
148 | 107 | | |
149 | 108 | | |
150 | | - | |
| 109 | + | |
151 | 110 | | |
152 | 111 | | |
153 | 112 | | |
| |||
159 | 118 | | |
160 | 119 | | |
161 | 120 | | |
162 | | - | |
| 121 | + | |
163 | 122 | | |
164 | 123 | | |
165 | 124 | | |
| |||
215 | 174 | | |
216 | 175 | | |
217 | 176 | | |
218 | | - | |
| 177 | + | |
219 | 178 | | |
220 | 179 | | |
221 | | - | |
| 180 | + | |
222 | 181 | | |
223 | 182 | | |
224 | 183 | | |
225 | 184 | | |
226 | | - | |
| 185 | + | |
227 | 186 | | |
228 | | - | |
| 187 | + | |
229 | 188 | | |
230 | 189 | | |
231 | 190 | | |
| |||
245 | 204 | | |
246 | 205 | | |
247 | 206 | | |
248 | | - | |
| 207 | + | |
249 | 208 | | |
250 | 209 | | |
251 | 210 | | |
| |||
406 | 365 | | |
407 | 366 | | |
408 | 367 | | |
409 | | - | |
| 368 | + | |
410 | 369 | | |
411 | 370 | | |
412 | 371 | | |
| |||
582 | 541 | | |
583 | 542 | | |
584 | 543 | | |
585 | | - | |
| 544 | + | |
586 | 545 | | |
587 | 546 | | |
588 | 547 | | |
| |||
0 commit comments