fix(reconciler): parameterize circuit breaker SQL query#2013
Merged
jrf0110 merged 1 commit intoconvoy/fix-reconciler-p0-p1-bug-fixes-from-audi/892c7c4a/headfrom Apr 5, 2026
Conversation
Compute the cutoff timestamp in JS and pass it as a bound SQL parameter instead of interpolating CIRCUIT_BREAKER_WINDOW_MINUTES into the query string via a template literal. Same 30-minute window, no behavioral change.
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (1 files)
Reviewed by gpt-5.4-20260305 · 161,774 tokens |
dbf82c3
into
convoy/fix-reconciler-p0-p1-bug-fixes-from-audi/892c7c4a/head
2 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.
Summary
Replace
strftime()template literal interpolation in the circuit breaker SQL query with a JS-computed cutoff timestamp passed as a bound SQL parameter. TheCIRCUIT_BREAKER_WINDOW_MINUTESconstant is now used to compute the ISO 8601 cutoff in JS (new Date(Date.now() - N * 60_000).toISOString()), then passed via?binding instead of being interpolated into the query string. Same 30-minute window, no behavioral change.Verification
toISOString()produces the same ISO 8601 format thatstrftime('%Y-%m-%dT%H:%M:%fZ', ...)would, and string comparison with>works identically.Visual Changes
N/A
Reviewer Notes
AGENTS.md.Date.now()call happens at function invocation time, so the cutoff is computed once per reconciler tick, which matches the previous behavior of SQLite'snowbeing evaluated at query execution time.