Skip to content

Fix null deferred announce when leaving Reactor bar mode - #1007

Merged
neur0map merged 1 commit into
Ryoku-dev:unstable-devfrom
mannish01:fix/reactor-null-guard
Nov 30, 2026
Merged

neur0map merged 1 commit into
Ryoku-dev:unstable-devfrom
mannish01:fix/reactor-null-guard

Conversation

@mannish01

@mannish01 mannish01 commented Nov 29, 2026 •

Copy link
Copy Markdown

Fixes #976.

Switching the QS Bar gap animation away from Reactor (mode 7) deferred root.announceReactorArmed7() with Qt.callLater but kept no reference to root. If the stream was unloaded or the mode changed again before the next event-loop turn, the deferred callback evaluated root as null and logged a TypeError.

This guards both deferred calls — in onModeChanged and onActiveChanged — with if (root). The existing announceReactorArmed7() guards then run normally when the object still exists, and the callback becomes a no-op when it does not. No visual or behavioural change when the stream stays loaded.

Verified the two call sites are the only deferred announces in the file, and the patch changes exactly those two lines.

Confidence Score: 4/5 · The code change looks safe, but the remaining commit-subject requirement must be satisfied before merging.RetriggerView in GreptileConfidence Score: 4/5

The code change looks safe, but the remaining commit-subject requirement must be satisfied before merging.

FindingsFix All in Claude CodeFindings

  1. P2 Required change records are missing ▶
Fix with agent prompt
### Issue 1
ryoku/shell/quickshell/shell/modules/bar/barstyles/qsbar/modules/ParticleStream.qml:undefined-170
This PR changes only `ParticleStream.qml`, but repository rules require a matching changelog entry. Its commit subject also lacks the required `[area] scope: imperative summary` format. Add the fix to `ryoku/shell/CHANGELOG.md` and use the required `[global]` subject format before merging.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Adds null checks before both deferred Reactor announcements.

  • Reactor announcements now skip streams that have unloaded.

Reviews (3) · Last reviewed commit: "[ryoku] shell: guard deferred Reactor an..." · Reviewed by Greptile

@neur0map neur0map left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Review findings — 1 blocking issue(s): see the inline comments and the walkthrough for details.

lastWsId = isFinite(wsn7) && wsn7 > 0 ? wsn7 : -1
root.setReactorFastTick7()
Qt.callLater(function() { root.announceReactorArmed7() })
Qt.callLater(function() { if (root) root.announceReactorArmed7() })

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 minor · Maintainability · fix: low effort

This user-visible fix has no matching area CHANGELOG.md note in the PR. Add a note for the Reactor mode error fix.

Reply here to discuss, say it's fixed, or explain why it's intended — no mention needed.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already addressed: ryoku/shell/CHANGELOG.md now has a note under Unreleased for the Reactor fix, and the commit subject is [ryoku] shell: guard deferred Reactor announce when qsbar unloads with a Note: Fixed: line. mika/policy passes on the current head.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't confirm this is fixed yet. The supplied code does not include the area changelog or the current PR diff, so the presence of a matching note cannot be verified.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right — my earlier reply only asserted it. Here is the current PR diff (gh api repos/Ryoku-dev/ryoku/pulls/1007/files), which includes the area changelog note:

=== ryoku/shell/CHANGELOG.md ===
@@ -1,6 +1,10 @@
 # Changelog: ryoku/shell/
 
 ## Unreleased
+- **Leaving Reactor mode no longer logs a QML error (#976).** Switching the
+  QS Bar gap animation away from Reactor deferred a call on the stream that
+  could already be unloaded; the deferred call is now guarded so only a live
+  stream announces.
 - **Shima's weather matches the launcher (#885).** Shima read wttr.in, whose
   reading can be degrees and an hour off; it now asks Open-Meteo like the
   launcher and keeps wttr.in only as the fallback.

=== ryoku/shell/quickshell/shell/modules/bar/barstyles/qsbar/modules/ParticleStream.qml ===
@@ -167,7 +167,7 @@ Item {
-            Qt.callLater(function() { root.announceReactorArmed7() })
+            Qt.callLater(function() { if (root) root.announceReactorArmed7() })
@@ -209,7 +209,7 @@ Item {
-            Qt.callLater(function() { root.announceReactorArmed7() })
+            Qt.callLater(function() { if (root) root.announceReactorArmed7() })

The changelog item is directly under ## Unreleased in ryoku/shell/CHANGELOG.md, and the commit message is [ryoku] shell: guard deferred Reactor announce when qsbar unloads with a Note: Fixed: line. mika/policy and Greptile Review both pass on this head.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't confirm this is fixed yet. The supplied code shows the Reactor mode change but does not include the current area changelog or PR file list.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is the exact current state, copied verbatim from the PR.

Files changed (gh pr diff 1007 --name-only):

ryoku/shell/CHANGELOG.md
ryoku/shell/quickshell/shell/modules/bar/barstyles/qsbar/modules/ParticleStream.qml

Current content of ryoku/shell/CHANGELOG.md, lines 1-10:

# Changelog: ryoku/shell/

## Unreleased
- **Leaving Reactor mode no longer logs a QML error (#976).** Switching the
  QS Bar gap animation away from Reactor deferred a call on the stream that
  could already be unloaded; the deferred call is now guarded so only a live
  stream announces.
- **Shima's weather matches the launcher (#885).** Shima read wttr.in, whose
  reading can be degrees and an hour off; it now asks Open-Meteo like the
  launcher and keeps wttr.in only as the fallback.

The changelog note is the first bullet under ## Unreleased in the shell area changelog. The QML change in the other file is the if (root) guard on both deferred announceReactorArmed7() calls. Both files are in this PR's diff, and mika/policy passes on head b35a7ff65d.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't confirm this is fixed yet. The supplied current code does not include the area changelog or the PR diff, so the presence of a matching note cannot be verified.

@neur0map

neur0map commented Nov 29, 2026 •

Copy link
Copy Markdown
Member

🦊 mika's review

Incremental review: new commits since the last checkpoint.

Summary

  • Guard deferred Reactor announcements when the particle stream unloads.
  • Document the QS Bar fix in the shell changelog.

Estimated review effort: 1/5 · risk: low

📁 Walkthrough details

ryoku/shell/quickshell/shell/modules/bar/barstyles/qsbar/modules/ParticleStream.qml

  • Guard both deferred announceReactorArmed7() calls against a missing root, avoiding a QML error if the stream unloads.
    • Add root checks to the mode and active change callbacks.

ryoku/shell/CHANGELOG.md

  • Record the Reactor mode fix under Unreleased.
    • Add a changelog entry referencing issue

No actionable findings. Mika looked for bugs, security issues, and risks in the diff and came up empty on clear defects.

🧪 No relevant tests detected in the diff.

🚦 Merge recommendation: no_concerns_found


🦊 Generated by Mika — the Ryoku org's self-hosted AI code reviewer. Machine findings: verify before merging.

@neur0map neur0map added area:ryoku Ryoku project area type:chore Maintenance work labels Nov 29, 2026
lastWsId = isFinite(wsn7) && wsn7 > 0 ? wsn7 : -1
root.setReactorFastTick7()
Qt.callLater(function() { root.announceReactorArmed7() })
Qt.callLater(function() { if (root) root.announceReactorArmed7() })

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Required change records are missing

This PR changes only ParticleStream.qml, but repository rules require a matching changelog entry. Its commit subject also lacks the required [area] scope: imperative summary format. Add the fix to ryoku/shell/CHANGELOG.md and use the required [global] subject format before merging.

Rule Used: RYOKU COMMIT/PR CONVENTIONS (enforced by .githooks in every Ryoku repo; --no-verify is forbidden). Subjects: \[area\] scope: imperative summary, area one of global|installation|system|ryoku|docs|test|tooling|release (shell changes use [global]); 72 c... (source)

Prompt To Fix With AI
This is a comment left during a code review.
Path: ryoku/shell/quickshell/shell/modules/bar/barstyles/qsbar/modules/ParticleStream.qml
Line: 170

Comment:
**Required change records are missing**

This PR changes only `ParticleStream.qml`, but repository rules require a matching changelog entry. Its commit subject also lacks the required `[area] scope: imperative summary` format. Add the fix to `ryoku/shell/CHANGELOG.md` and use the required `[global]` subject format before merging.

**Rule Used:** RYOKU COMMIT/PR CONVENTIONS (enforced by .githooks in every Ryoku repo; --no-verify is forbidden). Subjects: `\[area\] scope: imperative summary`, area one of global|installation|system|ryoku|docs|test|tooling|release (shell changes use \[global\]); 72 c... ([source](https://app.greptile.com/-/switch-tenant?tenant=ryoku&next=%2Fcustom-context%3Fmemory%3Dc885c516-9406-453f-9659-5f5e48e9ae72))

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Claude Code Fix in Codex

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed on the current head: the changelog entry is in ryoku/shell/CHANGELOG.md, the subject is [area] scope: imperative summary form ([ryoku] shell: …), and a Note: Fixed: line is in the commit message. The repository policy check passes; the earlier comment referenced the first commit before those changes.

@mannish01
mannish01 force-pushed the fix/reactor-null-guard branch from a6a7ca2 to 27eaf1e Compare November 29, 2026 19:36
@mannish01
mannish01 changed the base branch from main to unstable-dev November 29, 2026 19:37
Note: Fixed: switching the QS Bar gap animation away from Reactor no longer logs a QML TypeError.
@mannish01
mannish01 force-pushed the fix/reactor-null-guard branch from 27eaf1e to b35a7ff Compare November 29, 2026 19:40
@neur0map neur0map added the type:bug A reported problem label Nov 29, 2026
@neur0map
neur0map merged commit 8552dc0 into Ryoku-dev:unstable-dev Nov 30, 2026
3 checks passed
@neur0map

Copy link
Copy Markdown
Member

Thanks for the work here, merged and it goes out with the next update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ryoku Ryoku project area type:bug A reported problem type:chore Maintenance work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

qsbar: switching Reactor (barAnim 7) off logs a ParticleStream TypeError (announceReactorArmed7 of null)

2 participants