Conversation
|
@cursor review |
There was a problem hiding this comment.
This PR is being reviewed by Cursor Bugbot
Details
You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
| "", | ||
| errorMsg, | ||
| )) | ||
| } |
There was a problem hiding this comment.
Bug: V1 handler passes error messages to wrong analytics field
The logEventRegistrationValidationFailure function in v1 handler passes errorMsg as the fourth parameter (messageHash) to NewBridgeMessageValidationFailedEvent, causing error messages like "Last-Event-ID should be int" to be stored in the EncryptedMessageHash field. Compare to the v3 handler which correctly uses requestType as the second parameter and passes it to the third position (requestType). This results in incorrect analytics data where error messages are recorded as message hashes rather than properly categorized request types.
| TON_ANALYTICS_URL: "http://analytics-mock:9090/events" | ||
| TON_ANALYTICS_NETWORK_ID: "-239" | ||
| TON_ANALYTICS_BRIDGE_VERSION: "test-1.0.0" | ||
| TON_ANALYTICS_BRIDGE_URL: "http://bridge-instance2:8080" |
There was a problem hiding this comment.
Bug: Copy-paste error in bridge3 analytics URL configuration
The bridge3 service has TON_ANALYTICS_BRIDGE_URL set to "http://bridge-instance2:8080" which is copied from the bridge2 service configuration. This causes bridge3 to report itself as bridge-instance2 in analytics events, making it impossible to distinguish which bridge instance generated the events. The URL should reference bridge3's own endpoint.
| TON_ANALYTICS_URL: "http://analytics-mock:9090/events" | ||
| TON_ANALYTICS_NETWORK_ID: "-239" | ||
| TON_ANALYTICS_BRIDGE_VERSION: "test-1.0.0" | ||
| TON_ANALYTICS_BRIDGE_URL: "http://bridge-instance1:8080" |
There was a problem hiding this comment.
Bug: Copy-paste error in memory docker-compose analytics URL
The TON_ANALYTICS_BRIDGE_URL is set to "http://bridge-instance1:8080" but the service is named "bridge" and runs on port 8081. There is no "bridge-instance1" service in this compose file. This is a copy-paste error that will cause analytics events to report an incorrect and nonexistent bridge URL.
| TON_ANALYTICS_URL: "http://analytics-mock:9090/events" | ||
| TON_ANALYTICS_NETWORK_ID: "-239" | ||
| TON_ANALYTICS_BRIDGE_VERSION: "test-1.0.0" | ||
| TON_ANALYTICS_BRIDGE_URL: "http://bridge-instance1:8080" |
There was a problem hiding this comment.
Bug: Copy-paste error in postgres docker-compose analytics URL
The TON_ANALYTICS_BRIDGE_URL is set to "http://bridge-instance1:8080" but the service is named "bridge" and runs on port 8081. There is no "bridge-instance1" service in this compose file. This is a copy-paste error that will cause analytics events to report an incorrect and nonexistent bridge URL.
* sync time between bridges * add docs * fixes after review
…EstablishedEvent, CreateBridgeClientConnectErrorEvent, CreateBridgeClientMessageDecodeErrorEvent
7cc85e1 to
3aa0f63
Compare
…idge into ton-analytics-send-events
Note
Adds a batched TON Analytics pipeline (ring buffer + collector + event builder) and integrates it into v1/v3 handlers and storages, with new config/env, Docker mock, tests, and updated tonmetrics schemas.
internal/analyticswithRingCollector, periodicCollector, andEventBuilderfor bridge events.TonMetricsSenderand batch sending viatonmetricsclient; support noop client forwarding to mock.cmd/bridge,cmd/bridge3); emit events on subscribe/unsubscribe, message sent/received/expired, validation/verify.bridge-message-expired; adjust constructors to accept analytics deps.TON_ANALYTICS_*(ENABLED,URL,BRIDGE_VERSION,BRIDGE_URL,NETWORK_ID).analytics-mockservice andDockerfile.analytics-mock; propagate analytics envs across compose files.tonmetricsOpenAPI models (e.g.,bridge-verify,bridge-verify-validation-failed) and batch/eventsendpoints.Written by Cursor Bugbot for commit 72513d8. This will update automatically on new commits. Configure here.