Feat/update client with 429 and job progress - #225
Merged
Merged
Conversation
… sparse background-job progress notifications Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Coverage Report for CI Build 35258960527Coverage decreased (-0.8%) to 95.991%Details
Uncovered Changes
Coverage Regressions5 previously-covered lines in 1 file lost coverage.
Coverage Stats
💛 - Coveralls |
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
The notification callbacks were inserted ahead of polling settings that are already part of the v0.9.6 constructor signature. Positional callers would silently configure callbacks instead of their intended polling intervals, so keep the new notification settings keyword-only and cover the released positional layout with a regression test. Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
Job status requests intentionally pass HTTP 422 responses through for wait_for_job to interpret. After a 429 retry, calling every such response successful could contradict the failed job result, so report the actual HTTP status for passed-through errors and retain success wording only for 2xx responses. Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
BelhsanHmida
approved these changes
Sep 17, 2026
BelhsanHmida
left a comment
Contributor
There was a problem hiding this comment.
I reviewed and tested this PR locally and added two small fixes in separate commits:
38dcc9epreserves the positional constructor API released in v0.9.6 by making the new notification settings keyword-only. It also adds a regression test confirming that positionaljob_polling_*values still bind to the intended fields.5d4f892corrects the rate-limit recovery notice for passed-through error responses. A429followed by a422job response now reports the actual HTTP status instead of saying that the request succeeded, with a regression test covering that sequence.
Verification completed locally:
- Full test suite: 277 passed
- Full HEMS end-to-end run against an isolated current FlexMeasures server: passed
- Asset setup, 14 initial ingestion jobs, six forecasts, all 12 scheduling simulation steps, per-step site/community aggregation, and final KPI reports completed successfully
- The persisted workflow marker contains all five completed phases
- A second resume run detected the completed setup and correctly skipped every phase
The core 429 retry behavior, Retry-After handling, job polling, and HEMS workflow changes otherwise look sound.
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.
The client was not reacting properly to the 429 / Retry-After information.
We added some other improvements: