-
Notifications
You must be signed in to change notification settings - Fork 31
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
feat(rfq-api): don't respond to passive quotes for requests with zap params [SLT-430, SLT-432] #3388
feat(rfq-api): don't respond to passive quotes for requests with zap params [SLT-430, SLT-432] #3388
Changes from all commits
f8d361d
54da64d
98a0bad
839ab03
81bf628
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -198,6 +198,8 @@ func (c *wsClient) sendRelayerRequest(ctx context.Context, req *model.WsRFQReque | |
|
||
// handleRelayerMessage handles messages from the relayer. | ||
// An error returned will result in the websocket connection being closed. | ||
// | ||
//nolint:cyclop | ||
func (c *wsClient) handleRelayerMessage(ctx context.Context, msg []byte) (err error) { | ||
_, span := c.handler.Tracer().Start(ctx, "handleRelayerMessage", trace.WithAttributes( | ||
attribute.String("relayer_address", c.relayerAddr), | ||
|
@@ -235,7 +237,9 @@ func (c *wsClient) handleRelayerMessage(ctx context.Context, msg []byte) (err er | |
} | ||
case SendQuoteOp: | ||
err = c.handleSendQuote(ctx, rfqMsg.Content) | ||
logger.Errorf("error handling send quote: %v", err) | ||
if err != nil { | ||
logger.Errorf("error handling send quote: %v", err) | ||
} | ||
Comment on lines
+240
to
+242
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification Potential race condition in error logging after connection closure Errors may be logged after the WebSocket connection has been closed. Consider verifying the connection state before logging errors to prevent misleading log entries. 🔗 Analysis chainVerify error logging after connection closure There might be a race condition where errors are logged after the connection is closed. Consider adding a check for connection state before logging errors to avoid misleading logs. 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Search for patterns where errors might be logged after connection closure
rg -A 5 "conn.*Close|close\(.*doneChan\)"
Length of output: 2740 |
||
default: | ||
logger.Errorf("received unexpected operation from relayer: %s", rfqMsg.Op) | ||
return nil | ||
|
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.
🛠️ Refactor suggestion
Improve error handling in isZapQuote function
The function has a few potential issues:
Apply this diff to improve error handling and clarity:
📝 Committable suggestion