-
Notifications
You must be signed in to change notification settings - Fork 0
FIx #107 and #108 #110
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 #107 and #108 #110
Conversation
Fixes #108: Default Hyperliquid venue ID may never be created - Remove early return when existing venue has same (type, wallet) but different ID - Always attempt to upsert the default venue (hyperliquid:default) - Handle unique constraint violations gracefully with informative logging - Ensures canonical default venue identifier exists or logs why it cannot Fixes #107: Respect user-specified deal worker and resync settings - Remove user-configurable flags for deal-workers and resync-interval - Remove corresponding environment variable support - These settings are now determined solely by ThreeCommas plan tier - Prevents rate limit violations from user misconfiguration - Users cannot override rate-limit-aware tier defaults
0425ca0 to
02e4361
Compare
- Update specs/rate_limit.adoc to clarify DealWorkers and ResyncInterval are tier-determined only, not user-configurable - Update specs/multi_venue_emission.adoc to document conflict handling for default venue creation - Add unit tests for #108 (default venue with conflicting user venue) - Tests ensure issue #108 won't regress in the future
02e4361 to
9c65fad
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| existingVenue, err := s.queries.GetVenueByTypeAndWallet(ctx, sqlcgen.GetVenueByTypeAndWalletParams{ | ||
| Type: defaultHyperliquidVenueType, | ||
| Wallet: wallet, | ||
| }) | ||
| if err == nil { | ||
| // A venue with this (type, wallet) already exists. | ||
| // If it has a different ID than the default, we should use it instead of trying to create a duplicate. | ||
| if existingVenue.ID != string(defaultHyperliquidVenueID) { | ||
| // There's already a user-defined venue with this type and wallet. | ||
| // No need to create a separate default venue - just return success. | ||
| return nil | ||
| } | ||
| // The existing venue has the default ID, so we can proceed with the upsert. | ||
| } else if !errors.Is(err, sql.ErrNoRows) { | ||
| return err | ||
| } | ||
| hasConflictingVenue := err == nil && existingVenue.ID != string(defaultHyperliquidVenueID) |
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.
Handle errors when querying existing venues
The new logic queries GetVenueByTypeAndWallet to detect conflicting venues but ignores any error other than the implicit ErrNoRows. If this lookup fails (e.g., transient database failure), execution continues as though no error occurred and later code may return nil or a different error while the real cause is hidden. The previous implementation surfaced these errors, so this change regresses error handling and can mask storage failures. The function should still return the query error unless it is ErrNoRows.
Useful? React with 👍 / 👎.
Return errors from GetVenueByTypeAndWallet query unless they are sql.ErrNoRows. The previous version silently ignored database failures which could mask storage issues.
|
@codex review |
|
Codex Review: Didn't find any major issues. Nice work! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
No description provided.