Skip to content

Use trigger config for pre/post duration and recorder config#1362

Merged
waltjones merged 2 commits into
masterfrom
waltjones/use-trigger-duration
Oct 10, 2025
Merged

Use trigger config for pre/post duration and recorder config#1362
waltjones merged 2 commits into
masterfrom
waltjones/use-trigger-duration

Conversation

@waltjones

Copy link
Copy Markdown
Contributor

Description of the change

Replaces recorder options maxSeconds and postDuration with trigger configs driver by the replayManager config. This allows each trigger to independently define its preDuration and postDuration. This also derives maxPreDuration from the trigger config, replacing maxSeconds in the recorder initialization.

The heart of this update is in ReplayManager.capture, where trigger.preDuration and trigger.postDuration for the matching trigger are now used for the current capture request.

Notes:

  • Reconfiguration (configure method) is now driven through ReplayManager.
  • The recorder buffers are not reconfigured on configure, keeping the previous behavior.
  • The postDuration behavior has been updated, but preDuration behavior is left as is. (Trailing duration is by default the length of the current recording buffer, and doesn't (yet) explicitly use preDuration.)

Type of change

  • Refactor

Development

  • Lint rules pass locally
  • The code changed/added as part of this pull request has been covered with tests
  • All tests related to the changed code pass in development

@waltjones waltjones force-pushed the waltjones/use-trigger-duration branch from b383984 to ffefa59 Compare October 10, 2025 13:31

@matux matux left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks excellent!

Comment thread src/browser/core.js

this.tracing?.configure(this.options);
this.replayManager?.recorder?.configure(this.options);
this.replayManager?.configure(this.options);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

@waltjones waltjones merged commit a92b382 into master Oct 10, 2025
6 checks passed
@waltjones waltjones deleted the waltjones/use-trigger-duration branch October 10, 2025 13:54
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.

2 participants