Repository navigation
Conversation
❌ ErrorsYour PR has failed checks. Please review the issues below and take necessary action before merging. 🚦 1 Pipeline job failed
ℹ️ InfoNo other issues found (see more)🧪 All tests passed 🎯 Code Coverage (details) Useful? React with 👍 / 👎 This comment will be updated automatically if new data arrives.🔗 Commit SHA: e050cd3 | Docs | View more details | Give us feedback! |
Bundles Sizes Evolution
|
8e9d84a to
1d9542c
Compare
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
| case 'open': | ||
| return state.openClocks | ||
| return state.pulseClocks |
There was a problem hiding this comment.
💬 suggestion: Looking at that, I guess we could maybe remove the pulse concept.
- pulseClocks -> openClocks
- recordPulse -> updateOpen
There was a problem hiding this comment.
I think we need the openClocks to record the timeToFirstMessage, for example:
connection opens at T0 -> no messages... -> heartbeat pulses, the openClocks would then change -> a message is sent or received -> timeToFirstMessage is computed from openClocks which is actually pulseClocks
There was a problem hiding this comment.
I will rename it to reportClocks, to be coherent with your next comments
An open connection can now be reported again at a later pulse: recordPulse dates its next open vital and bumps the snapshot version it rides on. The first open vital is dated at the open event; a pulse outside the open phase is ignored. Co-authored-by: Cursor <cursoragent@cursor.com>
Every WEBSOCKET_HEARTBEAT_INTERVAL (one minute), each connection in phase open reports a new websocket_open vital with the next snapshot version, so a long-lived connection is visible while it is open. One timer serves every connection, and only runs while one is open; a closing connection falls silent. Co-authored-by: Cursor <cursoragent@cursor.com>
…ading A background transition is the only signal mobile browsers guarantee before a page goes away, and a connection may not survive it. Open connections report a pulse on every PREPARE_URGENT_FLUSH, so the traffic they carried is sent before the page is frozen or lost. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
1d9542c to
2b63be9
Compare
Motivation
A connection held open for an hour is invisible until it closes, and one that dies without a close event reports nothing about the traffic it carried. Open connections now report where they are on a heartbeat.
Part of the WebSocket vitals stack. Every PR targets the previous one; the first one targets the
boris.dibon/websocket-vitalsintegration branch, which is merged intomainin one go once the whole stack is approved. #5055 stays open as the reference implementation: the tip of this stack is content-identical to it, rebased on the currentmain.Changes
Commit by commit:
recordPulse()dates the next open vital and bumps the snapshot version it rides on. The first open vital is dated at the open event; a pulse outside the open phase is ignored.WEBSOCKET_HEARTBEAT_INTERVAL(1 min, the rate Chrome throttles hidden tabs' timers to), every connection in phase open emits a newwebsocket_openvital. One timer serves every connection and only runs while one is open; a closing connection falls silent, so a hung close stops looking alive.PREPARE_URGENT_FLUSH, so the traffic is sent before the page is frozen or lost. On mobile, hidden is the only signal guaranteed at that point.Test instructions
yarn test:unit --spec "packages/browser-rum-core/src/domain/webSocket/*.spec.ts" --spec packages/browser-rum-core/src/browser/webSocketObservable.spec.tsyarn test:e2e -g "rum websockets"Note
check-staging-mergeis expected to fail:staging-40already contains the earlier merge of #5055, which touches the same files. It clears at the next staging bump; the other checks should be green.Checklist