Repository navigation
fix(majestic): don't let a missing info.json hide the config - #89
Conversation
- Treat 404 on api/v1/info.json as "no info", like the HTML fallback - Desktop camera page loads config even when info.json fails - Matches what the web API and connect service already did
PR Summary by QodoKeep Majestic config editable when info.json is unavailable
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo
1. Info failures go unobserved after config fails
|
| var infoTask = _majestic.GetInfoAsync(ep, ct); | ||
| await Task.WhenAll(cfgTask, infoTask).ConfigureAwait(false); | ||
| return (await cfgTask.ConfigureAwait(false), await infoTask.ConfigureAwait(false)); | ||
| var config = await cfgTask.ConfigureAwait(false); |
There was a problem hiding this comment.
1. Info failures go unobserved after config fails 🐞 Bug ☼ Reliability
GetMajesticStateAsync starts infoTask but awaits cfgTask before reaching the only await of infoTask. If config fails or is canceled first and the info request also faults, the method exits without observing that second exception, while its caller logs only the config failure.
Agent Prompt
## Issue description
The info request starts concurrently with config, but a config failure exits before the info task is observed.
## Fix Focus Areas
- src/OpenIPC.Viewer.App/ViewModels/SingleCameraPageViewModel.cs[1249-1265]
## Recommended Fix
Ensure the info task's completion or exception is observed even when the config await fails, without replacing the config error or making an info failure hide a valid config.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Fixes #88
Newer lite Majestic builds (gk7205v200,
2.6.09.24-lite) answer 404 on/api/v1/info.json. The desktop camera page loadedconfig.jsonandinfo.jsontogether viaTask.WhenAll, so the 404 threw away a perfectly good config and the panel showed "Majestic returned HTTP 404".MajesticHttpClient.GetInfoAsync: 404 now means "no info", same as the existing HTML-fallback caseSingleCameraPageViewModel: aninfo.jsonfailure (including a timeout) no longer fails the config loadCameraConnectServicealready treated info as optionalBuilds clean; not verified on a real camera.