🐛 Fix profiling <-> long task association regression#4045
🐛 Fix profiling <-> long task association regression#4045amortemousque merged 2 commits intomainfrom
Conversation
03c98a0 to
79756bc
Compare
There was a problem hiding this comment.
💡 Codex Review
browser-sdk/packages/rum-core/src/domain/longTask/longTaskCollection.spec.ts
Lines 165 to 168 in 03c98a0
The findLongTasks API now requires both start time and duration, but this legacy long-task test still calls it with a single argument. With strict TypeScript settings this produces “Expected 2 arguments, but got 1”, so the test suite no longer compiles. Pass the profiling window duration (e.g., the entry duration) into this call to align with the updated signature.
ℹ️ 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".
|
✅ Tests 🎉 All green!❄️ No new flaky tests detected 🎯 Code Coverage 🔗 Commit SHA: bbd2d52 | Docs | Datadog PR Page | Was this helpful? Give us feedback! |
Bundles Sizes Evolution
🚀 CPU Performance
🧠 Memory Performance
|
| notifyPerformanceEntries([entry]) | ||
|
|
||
| const longTask = (rawRumEvents[0].rawRumEvent as RawRumLongTaskEvent).long_task | ||
| const longTasks = longTaskCollection.longTaskContexts.findLongTasks(1234 as RelativeTime) |
There was a problem hiding this comment.
suggestion: could you adjust or add a test to illustrate the issue? In this case, if you were using findLongTasks with a time older than the long task start time, the long task wasn't returned.
Edit: I see you added tests below, but maybe add a test closer to the actual issue could be nice
Motivation
This PR fixes a regression introduced in #4013, where the profiler only linked long tasks that were active at startTime. It now links every long task that occurs during the profiling session.
Changes
findLongTaskswith the duration to get all long tasks that occur within that period.Test instructions
Checklist