Skip to content

Cap 1189 reset heartbeat on hidden - #1973

Draft
daniel-graham-amplitude wants to merge 3 commits into
CAP-1189-event-namingfrom
CAP-1189-reset-heartbeat-on-hidden
Draft

Cap 1189 reset heartbeat on hidden#1973
daniel-graham-amplitude wants to merge 3 commits into
CAP-1189-event-namingfrom
CAP-1189-reset-heartbeat-on-hidden

Conversation

@daniel-graham-amplitude

@daniel-graham-amplitude daniel-graham-amplitude commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

Checklist

  • Does your PR title have the correct title format?
  • Does your PR have a breaking change?:

Note

High Risk
Changes core event upload routing and queue semantics for delayed events, plus experimental video analytics event names and heartbeat-driven ingestion—mistakes could drop, duplicate, or mis-route production events.

Overview
Adds delayed event upload end-to-end: new delayedEventsServerUrl (US/EU defaults) and the destination plugin now batches events with delay.id to the delayed HTTP API, including payload translation (instant_events vs timed delayed), deduping superseded queue entries, and isFresh handling while a prior send is in flight.

Heartbeat now calls resetHeartbeat() when the document becomes hidden so delayed events flush sooner on background/hide.

Browser video capture is reworked to emit [Amplitude] Content Started / [Amplitude] Content Stopped via the shared client heartbeat (immediate start + long-timeout delayed stop that is updated during playback and flushed on real stop, teardown, or track failure). Playback treats waiting (buffering) as still active so sessions are not split; HTMLMediaElement / delivery_mode: audio are supported. VideoObserver infers waiting when the playhead stalls.

Tests and the test-server mock add coverage for delayed routing, stale events, visibility, and the new capture behavior.

Reviewed by Cursor Bugbot for commit 4c1ad0d. Bugbot is set up for automated code reviews on this repo. Configure here.

@daniel-graham-amplitude
daniel-graham-amplitude requested a review from a team as a code owner September 4, 2026 18:22
@linear-code

linear-code Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

CAP-1189

@daniel-graham-amplitude
daniel-graham-amplitude marked this pull request as draft September 4, 2026 18:22
@daniel-graham-amplitude
daniel-graham-amplitude changed the base branch from main to CAP-1189-event-naming September 4, 2026 18:23
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

size-limit report 📦

Path Size
packages/analytics-browser/lib/scripts/amplitude-min.js.gz 66.66 KB (+0.24% 🔺)
packages/session-replay-browser/lib/scripts/session-replay-browser-min.js.gz 135.38 KB (+0.04% 🔺)
packages/unified/lib/scripts/amplitude-min.umd.js.gz 219.69 KB (+0.03% 🔺)
@amplitude/element-selector (gzipped esm) 3.4 KB (0%)

…e-TypeScript into CAP-1189-reset-heartbeat-on-hidden
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