-
Notifications
You must be signed in to change notification settings - Fork 1
Fix validator #576
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix validator #576
Conversation
25a849a to
863eef6
Compare
There was a problem hiding this comment.
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 modifies validation rules for tokenized community actions and updates the expired events cleanup query along with several dependency version bumps. The changes aim to make certain validation fields optional temporarily while improving the database cleanup process.
Changes:
- Made "k" and "token_symbol" fields optional for CustomIONKindTokenizedCommunityAction validation (with a TODO to make them required later)
- Enhanced deleteExpiredEvents query to filter out hidden and deleted events, changed DELETE syntax to use USING clause, and added ordering by lookup_created_at
- Updated multiple Go dependencies including google.golang.org/api, google.golang.org/genproto packages, github.com/dundee/gdu/v5, github.com/dgraph-io/badger/v4, and github.com/googleapis/gax-go/v2
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| validation/validate.go | Made "k" and "token_symbol" optional fields for tokenized community action validation instead of required |
| database/query/query.go | Modified expired events cleanup to exclude hidden/deleted events, improved DELETE syntax, added ordering, and enhanced context cancellation handling |
| go.mod | Updated direct and indirect dependency versions for gdu, genproto, googleapis/gax-go, dgraph-io/badger, and google.golang.org/api |
| go.sum | Corresponding checksum updates for all modified dependencies |
Comments suppressed due to low confidence (3)
go.mod:338
- The version timestamps show a date of 2026-02-03, which is in the future. These appear to be pseudo-versions with incorrect dates. Pseudo-versions should follow the format v0.0.0-yyyymmddhhmmss-abcdefabcdef where the timestamp represents when the commit was made. Future dates could cause issues with Go module versioning and caching. Please verify these are the correct commit hashes and regenerate the pseudo-versions with the actual commit timestamps.
google.golang.org/genproto v0.0.0-20260203192932-546029d2fa20 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20260203192932-546029d2fa20 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260203192932-546029d2fa20 // indirect
database/query/query.go:126
- Off-by-one index comparison against length may lead to out-of-bounds read.
if len(tag) >= 3 && tag[3] != "" {
database/query/query.go:126
- Off-by-one index comparison against length may lead to out-of-bounds read.
Off-by-one index comparison against length may lead to out-of-bounds read.
if len(tag) >= 3 && tag[3] != "" {
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } | ||
|
|
||
| if len(events) < batchSize { | ||
| if len(events) < batchSize || ctx.Err() != nil { |
Copilot
AI
Feb 6, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The context cancellation check ctx.Err() != nil on this line is redundant. The loop condition on line 1388 already checks ctx.Err() == nil, and there's another context cancellation check in the select statement at lines 1405-1407. If the context is cancelled, the loop will exit on the next iteration due to the loop condition. This redundant check adds unnecessary complexity without providing additional benefit.
| if len(events) < batchSize || ctx.Err() != nil { | |
| if len(events) < batchSize { |
| and hidden = false | ||
| and deleted = false |
Copilot
AI
Feb 6, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new filtering conditions hidden = false AND deleted = false change the behavior of expired event cleanup by excluding hidden and deleted events from being deleted based on expiration. This means that events marked as hidden or deleted will persist even if they have expired, which could lead to accumulation of expired events that were previously marked for deletion. If this is intentional to prevent double-processing of already-deleted events, this should be documented. Otherwise, this could lead to a buildup of expired events in the database that were marked as hidden or deleted but never actually removed.
| and hidden = false | |
| and deleted = false |
No description provided.