Skip to content

Comments

Move trial analytics tracking to server-side#4117

Closed
yujonglee wants to merge 2 commits intomainfrom
server-side-trial-analytics
Closed

Move trial analytics tracking to server-side#4117
yujonglee wants to merge 2 commits intomainfrom
server-side-trial-analytics

Conversation

@yujonglee
Copy link
Contributor

  • Add ToAnalyticsPayload trait and PropertiesPayloadBuilder to analytics crate
  • Introduce SubscriptionConfig::with_analytics to inject analytics into the subscription service
  • Extract Stripe operations into stripe.rs and trial types/response logic into trial.rs
  • Implement ToAnalyticsPayload for TrialOutcome to emit trial_started/trial_skipped/trial_failed events with properties server-side
  • Remove duplicate trial analytics calls from frontend (login.tsx, account.tsx)
  • Fix StreamResponse::set_extra to merge extra metadata instead of replacing it
  • Fix auth context to deduplicate user_signed_in events fired on token auto-refresh

Made with Cursor

@netlify
Copy link

netlify bot commented Feb 20, 2026

Deploy Preview for hyprnote-storybook canceled.

Name Link
🔨 Latest commit b6c94a8
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote-storybook/deploys/69980c2b0590d80008eab685

@netlify
Copy link

netlify bot commented Feb 20, 2026

Deploy Preview for hyprnote canceled.

Name Link
🔨 Latest commit b6c94a8
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote/deploys/69980c2b0d9c130008aeb9d4

@yujonglee yujonglee closed this Feb 20, 2026
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 4 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

if let Some(last) = promoted.last() {
self.watermark = self.watermark.max(last.end_ms);
}
finalize_words(to_finalize, id_gen)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pre-final partials emitted before held word breaks ordering

High Severity

In apply_final, promoted pre-final partials are placed into to_finalize before the emitted words from stitch. The stitch function prepends the previously held word (from an earlier final batch) to the front of its emitted output. Since the held word chronologically precedes the pre-final partials, the resulting to_finalize vector is out of chronological order: [partials..., held_word, final_words...] instead of [held_word, partials..., final_words...]. Because finalize_words does not sort, the consumer receives out-of-order transcript words.

Fix in Cursor Fix in Web

pending_text: String,
pending_language: Option<String>,
pending_confidence: f64,
pending_cloud_job_id: u64,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Field pending_cloud_job_id is written but never read

Low Severity

The pending_cloud_job_id field on ChannelState is set (line 189) and cleared (line 230) but never read anywhere in the codebase. It appears intended for future validation (e.g., matching cloud_result_job_id against the pending value) but currently serves no purpose and is dead code.

Additional Locations (2)

Fix in Cursor Fix in Web

Some(keys)
} else {
None
};
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicated handoff extra HashMap construction code

Low Severity

The handoff_extra (line 248) and pending_handoff_extra (line 324) blocks are byte-for-byte identical — same condition, same HashMap keys and values. Since the confirmed-text branch returns early at line 298, only one of these is ever used per invocation. Computing it once before the branch point and reusing the single variable would eliminate the duplication.

Additional Locations (1)

Fix in Cursor Fix in Web

return LoopAction::Break;
}
state.pending_cloud_job_id = 0;
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cloud result uses overwritten segment start from new handoff

High Severity

The cloud handoff block (lines 188–191) overwrites cloud_handoff_segment_start before the cloud result block (lines 193–231) reads it. When a single StreamResult contains both a new cloud_handoff and a completed cloud_result from a previous job, line 196 reads the segment start of the new handoff instead of the old one. This produces a cloud correction transcript with the wrong start and duration. Swapping the two if blocks so the cloud result is processed first would fix it.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant