Skip to content

Gateway: Fix plan re-publish issue#4109

Merged
springfall2008 merged 5 commits into
mainfrom
fix/plan-re-send-gateway
Jun 22, 2026
Merged

Gateway: Fix plan re-publish issue#4109
springfall2008 merged 5 commits into
mainfrom
fix/plan-re-send-gateway

Conversation

@springfall2008

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings June 22, 2026 08:53

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.

Pull request overview

This PR addresses a gateway execution-plan re-publish problem by ensuring the periodic “keepalive” publish rebuilds the protobuf so the embedded timestamp is refreshed (rather than re-sending cached bytes). It also adds test coverage around the new re-publish behavior and bumps the Predbat version.

Changes:

  • Replaces the “re-send cached plan bytes” behavior with a rebuild-and-publish flow to refresh the plan timestamp.
  • Caches the last plan inputs (entries + timezone) to support rebuilding on periodic re-publish.
  • Adds unit tests validating republish interval gating and timestamp refresh semantics.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

File Description
apps/predbat/gateway.py Stores last plan inputs and adds _republish_plan_if_stale() to rebuild and republish a refreshed execution plan timestamp.
apps/predbat/tests/test_gateway.py Adds TestPlanRepublish to verify periodic republish behavior and gating conditions.
apps/predbat/predbat.py Version bump to v8.41.2.
coverage/cases/predbat_debug_pre_saving1.yaml.expected.json Updates expected output for an existing debug case.

Comment thread apps/predbat/gateway.py
Comment on lines 1179 to 1183
self._last_plan_data = data
self._last_plan_entries = plan_entries
self._last_plan_timezone = timezone_str
self._last_plan_publish_time = time.time()

Comment thread apps/predbat/gateway.py Outdated
springfall2008 and others added 4 commits June 22, 2026 09:58
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@springfall2008 springfall2008 merged commit 417d89c into main Jun 22, 2026
1 check passed
@springfall2008 springfall2008 deleted the fix/plan-re-send-gateway branch June 22, 2026 09:59
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.

2 participants