Repository navigation
fix(status-bar): tolerate missing provider snapshots - #9408
Conversation
📝 WalkthroughWalkthroughProvider visibility types and helpers now accept 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Taking a look! |
b8fee39 to
a7de8e1
Compare
|
Thanks @nsxdavid I'm going to try to merge now. Give me a few mins here |
|
Thanks so much for this, @nsxdavid — tolerate missing provider snapshots. Verified (fail-on-main/pass-on-branch), rebased on latest |
Summary
Fixes a status-bar crash that occurred when a rate-limit snapshot from an older main process omitted a provider key.
ELI5
Sometimes the app's bottom bar asked for provider info that hadn't arrived yet and choked on the empty answer. Now it waits calmly instead of crashing.
Root cause & fix
isProviderConfiguredandisProviderSnapshotPendingused a strictprovider === nullcheck, so anundefinedsnapshot (which happens when an older main process omits newly added provider keys) slipped past the guard and crashed onprovider.status. The fix switches to a looseprovider == nullcheck so bothnullandundefinedsnapshots are treated as pending. Configured providers stay visible while their snapshot loads; unconfigured providers stay hidden. No provider payloads or IPC contracts change.Evidence
Validated & rebased onto latest main during a bug-bash triage on 2026-07-23.
src/renderer/src/components/status-bar/status-bar-provider-visibility.test.tssrc/renderer/src/components/status-bar/status-bar-provider-visibility.tsTypeError: Cannot read properties of undefined (reading 'status'), including the older-main-process regression tests.oxlinton the fix source is clean; PR reportspnpm typecheckpassing.Trade-offs
None — pure fix.
Regression risk
Zero-regression: the change only widens a null check to also catch
undefined, so already-defined andnullsnapshots follow byte-identical paths. Behavior for configured, pending, and empty-state providers is unchanged and locked in by the passing 29-test suite. No IPC, payload, or platform-specific code is touched.Credit to @nsxdavid for the original fix. Validated, rebased, and (where applicable) hardened via automated bug-bash review; original fix design preserved.