Conversation
dgdavid
left a comment
There was a problem hiding this comment.
That's indeed a better fix than previous. Thanks for taking the time to investigate it and for the information added into the PR description. Much appreciated. Nice work 👍
|
BTW, this reminds me that we would like to improve both, the entire thing about the backend status (installation phase and isBusy stuff) and the App.tsx internal router... when time permits. |
| const [isLoading, setIsLoading] = useState(false); | ||
|
|
||
| if (!isEmpty(registration?.key)) return <Navigate to={PATHS.root} />; | ||
| if (!isEmpty(registration?.key) && selectedProduct) return <Navigate to={PATHS.root} />; |
There was a problem hiding this comment.
Weird to have the registration key set but the product not selected yet.
There was a problem hiding this comment.
That's because the product has been asynchronously selected from CLI in background. When using UI only this cannot happen.
There was a problem hiding this comment.
Thanks for the explanation. Make sense.
Using @imobachgs words
|
Prepare to release Agama 15: * #2258 * #2270 * #2277 * #2279 * #2283 * #2284 * #2285 * #2286 * #2287 * #2288 * #2291 * #2292 * #2293 * #2295 * #2297 * #2299 * #2300 * #2301 * #2302 * #2303 * #2305 * #2306 * #2307 * #2308 * #2309 * #2313 * #2314 * #2315 * #2317 * #2318 * #2319 * #2320 * #2321 * #2322 * #2323 * #2324 * #2325 * #2328 * #2329 * #2330 * #2331 * #2335 * #2336 * #2337 * #2338 * #2339 * #2340 * #2342 * #2345 * #2346 * #2348 * #2349 * #2350 * #2351 * #2352 * #2353 * #2354 * #2355 * #2357 * #2358 * #2359 * #2360 * #2361 * #2362 * #2363 * #2364 * #2365 * #2366 * #2368 * #2369 * #2370 * #2371 * #2372 * #2374 * #2377 * #2378 * #2379 * #2380 * #2381 * #2382 * #2384 * #2385 * #2386 * #2388 * #2389 * #2390 * #2391 * #2392 * #2394 * #2397 * #2398 * #2401 * #2403
Problem
Debugging
To debug the issue I have reverted the #2281 fix and added a small snippet which tracks using the History API into the
web/src/index.tsxfile:That revealed that the History API was switching quickly between the product selection page and the probing progress page:
The Firefox browser has a limit of 200 History API calls within 10 seconds. After that an error is reported and an exception is raised. That exception causes a crash in the React router resulting in empty screen.
The problematic code was in the main application router:
The problem happened when the selected product was not updated yet (
selectedProduct === undefined) but probing was already in progress (isBusy === true). In that case these conditions caused switching between the two paths as fast as possible. On my machine it was switching about 1000 times per second as displayed in the log above.A similar problem was present in the product selection page.
Solution
Testing