Skip to content

♻️ split Assembly into MainAssembly and RendererPipeline#133

Open
bcaudan wants to merge 6 commits into
mainfrom
bcaudan/renderer-assembly
Open

♻️ split Assembly into MainAssembly and RendererPipeline#133
bcaudan wants to merge 6 commits into
mainfrom
bcaudan/renderer-assembly

Conversation

@bcaudan

@bcaudan bcaudan commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Motivation

Assembly handled two unrelated things: renderer events (pre-assembled by the browser SDK, needing a few native attributes injected) and main-process events (assembled from scratch via the full hook chain).
All renderer tracks share the same origin (the bridge) and the same minimal enrichment need.

Splitting into MainAssembly and RendererPipeline makes the bridge the single entry point for all renderer events, keeps enrichment logic colocated, and makes adding future renderer tracks (logs, telemetry) straightforward.

Changes

  • Introduced MainAssembly, handling main-process RawEvents via the existing triggerRum/triggerTelemetry hook chain.
  • Introduced RendererPipeline, owning the bridge IPC channel and assembling renderer events. Emits END_USER_ACTIVITY for click actions before the session check, so a click after session inactivity expiry renews the session even when its timestamp falls outside the closed session window.
  • Added triggerRenderer hook registered by SessionContext, ViewContext, and commonContext for timestamp-based context injection on renderer events.
  • Removed source from RawEvent types; all raw events are now invariably main-process originated.

Test instructions

yarn typecheck && yarn test

Checklist

  • Tested locally (playground)
  • Added unit tests for this change.
  • Added e2e/integration tests for this change.
  • Updated related documentation.

bcaudan added 3 commits June 9, 2026 17:57
- RendererAssembly owns BRIDGE_CHANNEL/CONFIG_CHANNEL IPC, calls triggerRenderer hook, emits ServerRumEvent{source:RENDERER} directly
- UserActivityTracker now subscribes to ServerRumEvent{source:RENDERER} instead of RawRumEvent
- Remove renderer assembly logic from Assembly
- `Assembly` → `MainAssembly`
- `source` field removed from `RawRumEvent` / `RawTelemetryEvent` (always main-process)
- `BridgeHandler` deleted
@bcaudan bcaudan force-pushed the bcaudan/renderer-assembly branch from 95ec394 to 9757676 Compare June 9, 2026 16:16
@bcaudan

bcaudan commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 97576760c3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/domain/UserActivityTracker.ts Outdated
@bcaudan bcaudan changed the title ♻️ split Assembly into MainAssembly and RendererAssembly ♻️ split Assembly into MainAssembly and RendererPipeline Jun 11, 2026
bcaudan added 3 commits June 11, 2026 15:33
Use generateTelemetryErrors (IPC, no button click) so no browser SDK action is buffered before session close.
Otherwise, a delayed delivery of the pre-expiry click would accidentally renew the session
…ivity tracking

- rename RendererAssembly → RendererPipeline (broader responsibilities)
- emit END_USER_ACTIVITY for clicks before the DISCARDED check, so a click
  after session expiry renews the session even when its timestamp falls
  outside the closed session window
- delete UserActivityTracker (now superseded by RendererPipeline)
@bcaudan bcaudan force-pushed the bcaudan/renderer-assembly branch from 9757676 to 9af1dc2 Compare June 11, 2026 13:33
@bcaudan

bcaudan commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@bcaudan bcaudan marked this pull request as ready for review June 11, 2026 13:39
@bcaudan bcaudan requested a review from a team as a code owner June 11, 2026 13:39
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