Commit 1c10534
authored
Fix: InfiniteContainer refresh race condition (#4343)
Fixed #3490
Added a guard clause to `refreshImpl` in `InfiniteContainer` to prevent re-entrant calls when a refresh is already in progress. This fixes an issue where rapid pull-to-refresh actions could cause the container's content (specifically when containing a single item) to disappear temporarily due to race conditions during the removal and addition of components.
Also wrapped the user-defined `fetchComponents` call in a try-catch block to ensure the `requestingResults` flag is correctly reset even if an exception occurs, preventing the container from becoming stuck in a loading state.
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>1 parent 5cbcf9c commit 1c10534
1 file changed
+10
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
127 | 130 | | |
128 | | - | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
129 | 138 | | |
130 | 139 | | |
131 | 140 | | |
| |||
0 commit comments