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

Handle blob and numbers when parsing the value of 'this' object #558

Merged
merged 1 commit into from
Aug 14, 2018

Conversation

DatGuyJonathan
Copy link
Contributor

What does this PR do?

Blobs and numbers in an instance object look like this in the debug log:
VARIABLE_ASSIGNMENT|[18]|this|{"MyBlob":BLOB(6 bytes),"MyBlob2":BLOB(7 bytes),"MyDateTime":"2018-08-13T21:03:32 .769Z","MyDecimal":3.14,"MyTime":3723004}

It tries to parse that to create child variables for this. It runs into a JSON parse error because the blob value isn't a string, so we can stringify it before the parse then remove the quotes after the parse.

Also, after parsing a number, it gives VS Code a variable whose value isn't a string type so VS Code won't show it. We should save number values as a string.

Result:

blobbug

What issues does this PR fix or reference?

@W-5173095@

@DatGuyJonathan DatGuyJonathan force-pushed the jwidjaja/fixJsonParsingOfThisValue branch from d433ba1 to e27e308 Compare August 14, 2018 16:21
@codecov
Copy link

codecov bot commented Aug 14, 2018

Codecov Report

Merging #558 into develop will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #558      +/-   ##
===========================================
+ Coverage    73.35%   73.37%   +0.02%     
===========================================
  Files          149      149              
  Lines         5832     5837       +5     
  Branches       917      917              
===========================================
+ Hits          4278     4283       +5     
  Misses        1328     1328              
  Partials       226      226
Impacted Files Coverage Δ
...dx-apex-replay-debugger/src/core/logContextUtil.ts 90.9% <100%> (+2.02%) ⬆️
...lay-debugger/src/states/variableAssignmentState.ts 89.53% <100%> (+0.37%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9c89d5e...e27e308. Read the comment docs.

Copy link
Contributor

@JimSuplizio JimSuplizio left a comment

Choose a reason for hiding this comment

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

The fix is pretty straightforward.

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.

None yet

2 participants