Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 [RUM-3039] Fix missing pending mutations at view end #2598

Merged
merged 14 commits into from Feb 19, 2024

Conversation

amortemousque
Copy link
Contributor

@amortemousque amortemousque commented Feb 9, 2024

Motivation

We are missing records generated during the VIEW_END lifecycle callbacks (if no segment is already created) because no view is active at that time:

This PR introduce new BEFORE_XXX lifecycle events where the SDK contexts are still active allowing to send last pending records

Changes

  • Introduce new prefixed BEFORE_XXX and AFTER_XXX lifecycle events used by contexts to ensures the context is available during the non prefixed event callbacks.
  • Add view related contexts at BEFORE_VIEW_CREATED and close at AFTER_VIEW_ENDED
  • Stop the recorder at PAGE_EXITED to prevent unexpected records after the view is closed
  • Cleanly stop scrollObserver, moveObserver and instrumentSetter

Testing

  • Local
  • Staging
  • Unit
  • End to end

I have gone over the contributing documentation.

@codecov-commenter
Copy link

codecov-commenter commented Feb 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (ed48184) 92.81% compared to head (b173389) 92.96%.
Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2598      +/-   ##
==========================================
+ Coverage   92.81%   92.96%   +0.14%     
==========================================
  Files         236      236              
  Lines        6833     6850      +17     
  Branches     1499     1500       +1     
==========================================
+ Hits         6342     6368      +26     
+ Misses        491      482       -9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@amortemousque amortemousque marked this pull request as ready for review February 12, 2024 11:10
@amortemousque amortemousque requested a review from a team as a code owner February 12, 2024 11:10
@amortemousque amortemousque changed the title [RUM-3039] Fix missing pending mutations at view end 🐛 [RUM-3039] Fix missing pending mutations at view end Feb 12, 2024
@amortemousque
Copy link
Contributor Author

/to-staging

@dd-devflow
Copy link

dd-devflow bot commented Feb 12, 2024

🚂 Branch Integration: starting soon, merge in < 0s

Commit b4330d4d71 will soon be integrated into staging-07.

This build is going to start soon! (estimated merge in less than 0s)

Use /to-staging -c to cancel this operation!

@DataDog DataDog deleted a comment from dd-devflow bot Feb 12, 2024
@DataDog DataDog deleted a comment from dd-devflow bot Feb 12, 2024
dd-mergequeue bot added a commit that referenced this pull request Feb 12, 2024
…aging-07

Co-authored-by: Aymeric Mortemousque <aymeric.mortemousque@datadoghq.com>
@dd-devflow
Copy link

dd-devflow bot commented Feb 12, 2024

🚂 Branch Integration: This commit was successfully integrated

Commit b4330d4d71 has been merged into staging-07 in merge commit 9a0cc04877.

Check out the triggered pipeline on Gitlab 🦊

packages/rum/src/domain/record/record.ts Outdated Show resolved Hide resolved
@amortemousque amortemousque force-pushed the aymeric/improve-lifecycle-flow branch 3 times, most recently from d5495d8 to 922b351 Compare February 13, 2024 08:47
@amortemousque
Copy link
Contributor Author

/to-staging

@dd-devflow
Copy link

dd-devflow bot commented Feb 13, 2024

🚂 Branch Integration: starting soon, merge in < 9m

Commit 768b4a46fc will soon be integrated into staging-07.

This build is going to start soon! (estimated merge in less than 9m)

Use /to-staging -c to cancel this operation!

@dd-devflow
Copy link

dd-devflow bot commented Feb 13, 2024

🚨 Branch Integration: The build pipeline contains failing jobs for this merge request

We couldn't automatically merge the commit 768b4a46fc into staging-07.
Build pipeline has failing jobs for 2a4dad1

Since those jobs are not marked as being allowed to fail, the pipeline will most likely fail.
Therefore, and to allow other builds to be processed, this merge request has been rejected before the end of the pipeline.

You should have a look at the pipeline, wait for the build to finish and investigate the failures.
When you are ready, re-add your pull request to the queue!

⚠️ Do NOT retry failed jobs directly.

They were executed on a temporary branch created by the merge queue. If you retry them, they are going to fail because the branch no longer exists.

If you think the errors come from a logical conflict with the target branch, you can create a fix by commenting this pull request with /create-fix-branch -b staging-07

Details

List of failed jobs:

Go to failed Gitlab pipeline.

If you need support, contact us on Slack #ci-interfaces with those details!

@amortemousque amortemousque merged commit b9ebe46 into main Feb 19, 2024
17 checks passed
@amortemousque amortemousque deleted the aymeric/improve-lifecycle-flow branch February 19, 2024 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants