Skip to content

Settings Wi-Fi + Bluetooth panels: ignore results from a cleaned-up effect or a superseded load (CodeRabbit Minor on #4017) - #4019

Merged
jaylfc merged 2 commits into
devfrom
exec/tsk-w4432q
Oct 28, 2026
Merged

jaylfc merged 2 commits into
devfrom
exec/tsk-w4432q

Conversation

@jaylfc

@jaylfc jaylfc commented Oct 27, 2026 •

Copy link
Copy Markdown
Owner

CARD TITLE (intent, not commit subject): Settings Wi-Fi + Bluetooth panels: ignore results from a cleaned-up effect or a superseded load (CodeRabbit Minor on #4017)

Autonomous build of board card tsk-w4432q.

Fix race condition in Wi-Fi and Bluetooth settings panels

  • Remove mounted useRef and replace with active flag and sequence counter
  • In load(), capture mine = ++seq at start; guard every setState with if (!active || mine !== seq) return
  • Cleanup sets active = false and clears interval
  • Add tests that defer first fetch resolution past second to verify stale responses are ignored
  • Existing StrictMode tests continue to pass

Files:
changelog.d/tsk-w4432q-wifi-bluetooth-race-fix.md | 2 ++
.../src/apps/SettingsApp/BluetoothPanel.test.tsx | 32 ++++++++++++++++++++++
desktop/src/apps/SettingsApp/BluetoothPanel.tsx | 20 ++++++++++----
desktop/src/apps/SettingsApp/WifiPanel.test.tsx | 32 ++++++++++++++++++++++
desktop/src/apps/SettingsApp/WifiPanel.tsx | 20 ++++++++++----
5 files changed, 94 insertions(+), 12 deletions(-)

In-house review (pre-PR)

in-house-review: PASS (kilo/nvidia/nemotron-3-ultra-550b-a55b:free)

reviewer output

VERDICT: PASS

  • NIT: changelog.d/tsk-w4432q-wifi-bluetooth-race-fix.md:1 Missing trailing newline

In-house-Review: PASS model=kilo/nvidia/nemotron-3-ultra-550b-a55b:free head=86c05915f needs-lead=0

Summary by CodeRabbit

  • Bug Fixes
    • Wi-Fi and Bluetooth panels now keep newer device and network information or errors from being overwritten by delayed responses to earlier requests.

- Remove mounted useRef and replace with active flag and sequence counter
- In load(), capture mine = ++seq at start; guard every setState with if (!active || mine !== seq) return
- Cleanup sets active = false and clears interval
- Add tests that defer first fetch resolution past second to verify stale responses are ignored
- Existing StrictMode tests continue to pass
@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing

@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration
Commits

Reviewing files that changed from the base of the PR and between 86c0591 and 29ef46e.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 7724d9b and 86c0591.

Files selected for processing: 5
  • changelog.d/tsk-w4432q-wifi-bluetooth-race-fix.md
  • desktop/src/apps/SettingsApp/BluetoothPanel.test.tsx
  • desktop/src/apps/SettingsApp/BluetoothPanel.tsx
  • desktop/src/apps/SettingsApp/WifiPanel.test.tsx
  • desktop/src/apps/SettingsApp/WifiPanel.tsx

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

Walkthrough

Wi-Fi and Bluetooth panels now ignore results from inactive effects and superseded requests. Tests verify that older overlapping loads do not replace newer panel data.

Changes: Settings panel load guards

Layer / File(s) Summary
Guard and verify panel loads
desktop/src/apps/SettingsApp/WifiPanel.tsx, desktop/src/apps/SettingsApp/BluetoothPanel.tsx, desktop/src/apps/SettingsApp/WifiPanel.test.tsx, desktop/src/apps/SettingsApp/BluetoothPanel.test.tsx, changelog.d/tsk-w4432q-wifi-bluetooth-race-fix.md
Both panels use effect-local activity and request-sequence checks to ignore results from inactive effects or superseded requests. Tests resolve overlapping loads out of order and verify that newer data remains displayed. The changelog describes these guards.

Priority: Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

  • jaylfc/taOS#3988: Adds the WifiPanel component and its tests, which this change modifies.
Merge Risk: Minimal · previous review 86c05

The panels are intended to ignore stale responses, and no merge-blocking issue is established from the supplied evidence.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within survi… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly describes the main change: preventing stale Wi-Fi and Bluetooth panel results from updating state after effect cleanup or a newer load. The parenthetical review reference adds noise …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title clearly describes the main change: preventing stale Wi-Fi and Bluetooth panel results from updating state after effect cleanup or a newer load. The parenthetical review reference adds noise but does not make the title misleading.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 4 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 2
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gitar-bot

gitar-bot Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Gitar is working

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

Gitar

@jaylfc

jaylfc commented Oct 27, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@jaylfc

jaylfc commented Oct 28, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

No files to review.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@jaylfc
jaylfc merged commit ab48fa4 into dev Oct 28, 2026
40 of 42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant