Repository navigation
Stop live status banners flickering during polling - #10
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7de4346d4d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| states.set(method,{...old,method,label,view,state:'loading',detail:'Reading…',token});onChange(states.get(method)); | ||
| try{const result=await base[method].apply(base,args);if(states.get(method)?.token===token){const status=resultStatus(result);states.set(method,{...states.get(method),...status,checkedAt:Date.now(),lastSuccessAt:status.state==='success'?Date.now():old.lastSuccessAt});onChange(states.get(method));}return result;} | ||
| catch(error){if(states.get(method)?.token===token){states.set(method,{...states.get(method),state:'error',detail:String(error?.message||error),checkedAt:Date.now()});onChange(states.get(method));}throw error;} | ||
| states.set(method,{...old,method,label,view,state:'loading',detail:'Reading…',token});publish(states.get(method)); |
There was a problem hiding this comment.
Keep suppressed polling state out of the rendered state map
When a recurring getProcesses call starts, this still changes its public state to loading even though publish() suppresses its callback. If getInstalledApps changes while that process read is pending, its callback makes renderReadStatus('apps') rebuild the entire banner from statusTracker.states, exposing the suppressed loading state. If the app read finishes before the process read, the unchanged process success is also suppressed, so the banner can remain visibly stuck on Loading until another status publication (up to 30 seconds). Preserve the last published state separately from the in-flight state, or ensure rendering reads published snapshots.
Useful? React with 👍 / 👎.
Telemetry and process polling previously rebuilt read-status banners twice per sample by switching Ready → Loading → Ready. Keep the previous visible state during recurring reads, refresh unchanged timestamps at most every 30 seconds, and show errors, changed details, and recovery immediately. Sampling frequency and measurements are unchanged.
Validated with status regression tests, including repeated samples, immediate failures/recovery, timestamp cadence, and existing stale-result ordering checks; syntax check passed. Native Windows visual acceptance is still pending.