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

🐛 [Extension] Fix TypeError when document.cookie is empty #2216

Merged

Conversation

yannickadam
Copy link
Contributor

Motivation

Navigating to a site with no cookies and opening the developer panel leads to the extension erroring:

Datadog Browser SDK extension: [useSdkInfos] Error while getting SDK infos: Error: Failed to evaluate code: TypeError: Cannot read properties of null (reading 'slice')

Changes

Handle the case where document.cookie === '' and perhaps other parsing issues.

Testing

  • Local
  • Staging
  • Unit
  • End to end

I have gone over the contributing documentation.

@yannickadam yannickadam requested a review from a team as a code owner May 6, 2023 09:21
@codecov-commenter
Copy link

Codecov Report

Merging #2216 (b947b38) into main (de04f8a) will decrease coverage by 0.02%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #2216      +/-   ##
==========================================
- Coverage   93.81%   93.80%   -0.02%     
==========================================
  Files         201      201              
  Lines        6082     6082              
  Branches     1347     1347              
==========================================
- Hits         5706     5705       -1     
- Misses        376      377       +1     

see 4 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@yannickadam yannickadam merged commit 2a86a4d into main May 12, 2023
@yannickadam yannickadam deleted the yannick.adam/fix_extension_cannot_read_property_of_null branch May 12, 2023 12:48
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.

4 participants