fix(store): add missing "lt" operator to PG filter parser#6140
Merged
gustavosbarreto merged 1 commit intomasterfrom Apr 8, 2026
Merged
fix(store): add missing "lt" operator to PG filter parser#6140gustavosbarreto merged 1 commit intomasterfrom
gustavosbarreto merged 1 commit intomasterfrom
Conversation
The device cleanup cron job uses a "lt" (less than) filter to select devices with removed_at older than 30 days. The PG filter parser did not handle the "lt" operator, silently falling through to the default case which returned an empty condition. This caused the cleanup to run without any filter, deleting all devices regardless of their status. When agents reconnected after the cleanup, they created new devices as pending, making all previously accepted devices appear unapproved every morning at 2 AM UTC. Also add time.Time support to the existing "gt" operator for consistency. Fixes: #6134
|
Claude finished @gustavosbarreto's task in 1m 46s —— View job Code Review CompleteReviewed 1 file across code quality, security, testing, Go patterns, and architecture — no issues found. The code looks good as-is. The new To request another review round, comment |
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
Added the missing "lt" (less than) operator to the PostgreSQL
filter property parser, which was silently discarding the filter
condition used by the device cleanup cron job.
Why
The device cleanup cron (runs daily at 2 AM UTC) filters devices
with
removed_at < 30 days ago. Since the PG filter parser hadno handler for the "lt" operator, it fell through to the default
case returning an empty condition without error. The cleanup then
ran unfiltered, deleting all devices. Agents reconnecting
afterward created new pending devices, causing every accepted
device to revert to pending status every morning.
Fixes #6134
Changes
fromLt()with supportfor numeric types,
time.Time, and string valuestime.Timecase to theexisting
fromGt()for consistency