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

Fix duplicate RUM Errors #538

Conversation

louiszawadzki
Copy link
Contributor

What does this PR do?

This makes sure real iOS devices have time to update the crash context on the iOS SDK before actually crashing the app.
This way, when the app restarts it will pick up that a crash had happened and not send the duplicate native RUM Error.

I don't think we can have a "proper" fix that would wait for the crash context to be updated, or that would imply heavy changes.

The delay of 50ms is empirical. 5ms is too little for the crash context to be updated, 50ms gives us enough time in all my tests and the lag between the action and the crash is not noticeable.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)
  • If this PR is auto-generated, please make sure also to manually update the code related to the change

@louiszawadzki louiszawadzki requested a review from a team as a code owner October 11, 2023 13:16
@louiszawadzki louiszawadzki force-pushed the louiszawadzki/RUM-1359/fix-duplicate-rum-crashes-ios-devices branch from 8504f5d to e95d7fb Compare October 11, 2023 13:19
@@ -13,6 +13,8 @@ import type {
import { DdRumErrorTracking } from '../../../rum/instrumentation/DdRumErrorTracking';
import { BufferSingleton } from '../../../sdk/DatadogProvider/Buffer/BufferSingleton';

jest.mock('../../../utils/jsUtils');
Copy link
Member

Choose a reason for hiding this comment

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

Curious why this needed to be added?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't want to add a 50ms delay in all my tests here - it will make them harder to debug in case they go wrong.

I added a default mock under utils/__mocks__/jsUtils.ts that is used when I add this line in a test file.

@louiszawadzki louiszawadzki merged commit 6b7b5f9 into develop Oct 25, 2023
3 checks passed
@louiszawadzki louiszawadzki deleted the louiszawadzki/RUM-1359/fix-duplicate-rum-crashes-ios-devices branch October 25, 2023 13:26
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