Cap 1189 reset heartbeat on hidden - #1973
Draft
daniel-graham-amplitude wants to merge 3 commits into
Draft
Conversation
Contributor
daniel-graham-amplitude
marked this pull request as draft
September 4, 2026 18:22
daniel-graham-amplitude
changed the base branch from
main
to
CAP-1189-event-naming
September 4, 2026 18:23
size-limit report 📦
|
…e-TypeScript into CAP-1189-reset-heartbeat-on-hidden
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Checklist
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 withdelay.idto the delayed HTTP API, including payload translation (instant_eventsvs timed delayed), deduping superseded queue entries, andisFreshhandling 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 Stoppedvia 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 treatswaiting(buffering) as still active so sessions are not split;HTMLMediaElement/delivery_mode: audioare supported. VideoObserver inferswaitingwhen 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.