fix(solis): preserve queued window edits during startup - #4933
Merged
springfall2008 merged 1 commit intoSep 5, 2026
Conversation
Contributor
There was a problem hiding this comment.
🟢 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
merged commit Sep 5, 2026
2494518
into
fix/solis-callback-loop-affinity
3 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 solisand all pre-commit hooks for the changed files passed. The two existing unclosed-session warnings remain.This follow-up targets
fix/solis-callback-loop-affinityso its diff contains only the review fix for #4875.