Commit 1f0e7a6
committed
Fix sync race: return in-flight promise from syncSnapshot so welcome handler waits for actual sync completion
When syncSnapshot() was called while a sync was already in-flight, it
returned immediately (resolved promise) after setting pending=true.
This meant the onServerWelcome handler's SET_PROJECT_EXPANDED dispatch
ran against an empty store before projects were populated.
Now syncSnapshot() returns the in-flight syncPromise when syncing=true,
so callers actually wait for the sync to complete before proceeding.1 parent 3b8c5cd commit 1f0e7a6
1 file changed
+15
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
153 | 155 | | |
154 | 156 | | |
155 | | - | |
| 157 | + | |
156 | 158 | | |
157 | 159 | | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
166 | 171 | | |
167 | 172 | | |
168 | 173 | | |
| |||
0 commit comments