Repository navigation
fix(workbook): avoid duplicate recurring refresh chains on policy save - #69
Open
rudycelekli wants to merge 1 commit into
Open
rudycelekli wants to merge 1 commit into
rudycelekli wants to merge 1 commit into
Conversation
Signed-off-by: Rudy Celekli <47457359+rudycelekli@users.noreply.github.com>
6 of 10 tasks
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.
What changed
Saving an enabled workbook refresh policy now keeps an existing pending or processing
refresh_workbookjob instead of starting another recurring chain. The policy still persists normally; completed history does not prevent a new schedule, and disabled policies do not enqueue a new job.The existing worker continuation is unchanged. This preserves sequential saves, including when the existing owner is already due or claimed. It does not provide atomic deduplication for simultaneous requests, repair previously duplicated jobs, or reset the current scheduled deadline when the interval changes.
Reproduction and verification
The seven frozen regression cases use the real FastAPI
PUT /refresh-policyroute, real SQLAlchemy models and owned SQLite databases, with an authorized fixture user. Four cases fail against48aacfd44946bcf20201b58d989c0fe07cc40c09: repeated save, future pending owner, overdue pending owner and processing owner. The three policy persistence/disable/history controls pass. The same unchanged tests pass 7/7 after this change.tests/test_queue_load.py::test_load_harness_measures_invariants_and_cleans_up, where its SQLite tenant-cap measurement observed 3 active jobs for a cap of 2. This is retained as a failed check; it is not presented as green or attributed to a proven root cause. Accepted-main isolated comparisons passed 5/5; the accepted-main broad comparison was inconclusive: 2046 passed, 134 skipped, 3 deselected, 2 failed and 79 errors after disk exhaustion prevented temp-fixture setup/teardown; its bounded runner then timed out. This does not establish the load-harness failure is inherited.git diff --checkand changed Python compilation pass.Tests ran in an isolated Python 3.13 environment that reuses system packages and adds missing real dependencies locally. Key actual versions: FastAPI 0.115.14, SQLAlchemy 2.0.36, pytest 9.0.2, HTTPX 0.28.1 and Alembic 1.16.5. It is not equivalent to
uv run --frozen; no network providers or production databases were exercised. The unchanged repository four-job workflow subsequently passed on this exact signed head with fresh frozen dependencies: fork qualification37942526734. Backend SQLite: 2099 passed, 134 skipped, 3 deselected; PostgreSQL integrity/tenancy: 18 passed; mounted browser regressions: 3 passed. Frontend lint/tests/build also pass. All four jobs succeeded on signed28f3339d31c77451cf9d3d0bbace845f05e70c46. That canonical hosted success is separate from the retained local broader failure and inconclusive baseline; no root-cause attribution is inferred. Upstream PR checks will run separately after creation.AI-assisted implementation and testing, reviewed against the current contribution and security policies.