Skip to content

fix(solis): preserve queued window edits during startup - #4933

Merged
springfall2008 merged 1 commit into
fix/solis-callback-loop-affinityfrom
review/4875-fixes
Sep 5, 2026
Merged

fix(solis): preserve queued window edits during startup#4933
springfall2008 merged 1 commit into
fix/solis-callback-loop-affinityfrom
review/4875-fixes

Conversation

@mgazza

@mgazza mgazza commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Queued time-window edits in #4875 are applied before the first register decode, which replaces the local window cache and silently loses the edit. Drain events after polling and initial decoding, before writing the windows to the inverter.

The regressions exercise the real run() drain, including callbacks queued on a different event loop and continuation after a handler fails. The startup test fails on the original PR and passes with this fix.

Validation: unit_test.py --test solis and all pre-commit hooks for the changed files passed. The two existing unclosed-session warnings remain.

This follow-up targets fix/solis-callback-loop-affinity so its diff contains only the review fix for #4875.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The change is narrowly scoped, matches the stated failure mode, and the updated tests exercise the production drain path and cover the regression case.

Pull request overview

This PR fixes a Solis startup sequencing bug where queued time-window edits could be applied too early and then silently overwritten when the first register decode repopulates the local window cache. It moves the queued-event drain to run after initial polling/decoding but before writing time windows back to the inverter, ensuring edits persist and are applied reliably on the Solis component loop.

Changes:

  • Move queued-event draining in SolisAPI.run() to occur after the initial time-window decode and before the control/write phase.
  • Update Solis tests to exercise the real run()-based drain path (including cross-loop dispatch) and add a regression that verifies startup decode does not overwrite a queued edit.
File summaries
File Description
apps/predbat/solis.py Drains queued entity events after initial polling/decoding so queued window edits are preserved before writes.
apps/predbat/tests/test_solis.py Updates queue-drain tests to use production run() draining and adds a regression covering the startup decode overwrite scenario.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@springfall2008
springfall2008 merged commit 2494518 into fix/solis-callback-loop-affinity Sep 5, 2026
3 checks passed
@springfall2008
springfall2008 deleted the review/4875-fixes branch September 5, 2026 10:49
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.

3 participants