-
-
Notifications
You must be signed in to change notification settings - Fork 987
Corrected when analytics is being sent #4553
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
Conversation
- this is due to the data coming in later TODO: will move more to async / await calls
WalkthroughAn asynchronous function Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. ✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
|
Preview URL: https://2718188b.betaflight-configurator.pages.dev |
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/js/serial_backend.js (1)
83-96
: Remove unnecessaryasync
keyword or add proper async operations.The function is declared as
async
but contains noawait
operations. Sincetracking.sendEvent
appears to be synchronous, theasync
keyword is unnecessary.-async function sendConfigTracking() { +function sendConfigTracking() { tracking.sendEvent(tracking.EVENT_CATEGORIES.FLIGHT_CONTROLLER, "Loaded", { boardIdentifier: FC.CONFIG.boardIdentifier, targetName: FC.CONFIG.targetName, boardName: FC.CONFIG.boardName, hardware: FC.CONFIG.hardwareName, manufacturerId: FC.CONFIG.manufacturerId, apiVersion: FC.CONFIG.apiVersion, flightControllerVersion: FC.CONFIG.flightControllerVersion, flightControllerIdentifier: FC.CONFIG.flightControllerIdentifier, mcu: FC.CONFIG.targetName, deviceIdentifier: CryptoES.SHA1(FC.CONFIG.deviceIdentifier).toString(), }); }The implementation correctly sends comprehensive configuration data and properly hashes the deviceIdentifier for privacy.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/js/serial_backend.js
(4 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/js/serial_backend.js (2)
src/js/Analytics.js (1)
tracking
(7-7)src/js/fc.js (1)
FC
(130-993)
🔇 Additional comments (3)
src/js/serial_backend.js (3)
508-508
: Good async/await implementation.Adding
await
ensures proper sequencing of the asynchronousprocessCraftName()
call.
521-521
: Proper async sequencing maintained.The
await
ensuresprocessBuildOptions()
completes before the function returns, maintaining correct asynchronous flow.
531-532
: Excellent timing fix for analytics data availability.Moving the tracking call to
processUid
after UID retrieval ensures thedeviceIdentifier
is available before sending analytics, which addresses the core issue described in the PR objectives.The
await processBuildConfiguration()
properly maintains async sequencing. However, ifsendConfigTracking()
is made synchronous (as suggested in the earlier comment), then line 531 should be updated accordingly:- await sendConfigTracking(); + sendConfigTracking();
TODO: will move more to async / await calls
Summary by CodeRabbit