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

Debugger JS Coping date value in object will not be transfert #162747

Closed
maxime4000 opened this issue Oct 5, 2022 · 3 comments · Fixed by microsoft/vscode-js-debug#1414
Closed
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues verified Verification succeeded
Milestone

Comments

@maxime4000
Copy link

Does this issue occur when all extensions are disabled?: Not tested (Probably yes)

  • VS Code Version: 1.71.2
  • OS Version: 12.4 (MacOS)

Steps to Reproduce:
I have this object :

const x = {
  $and: [
    {
      renewalDate: {
        $gte: new Date("2022-10-05T04:00:00.000Z"),
        $lte: new Date("2022-11-05T03:59:59.999Z"),
      },
    },
  ],
};
  1. If I goes in chrome console and "copy object", this is what I get :
{
	"$and": [
		{
			"renewalDate": {
				"$gte": "2022-10-05T04:00:00.000Z",
				"$lte": "2022-11-05T03:59:59.999Z"
			}
		}
	]
}
  1. If I copy the same object from the debugger of vscode, this is what I get :
{
  $and: [
    {
      renewalDate: {
        $gte: {
        },
        $lte: {
        },
      },
    },
  ],
}
  1. I don't think I'm suppose to get empty object from date and it's really not helpful in my case because when I do this, it's because I want to take the aggregation I was working with and try it in Studio 3T and I can't without rewrite in memory value.
  2. Just comparing with WebStorm, this is not an issue for them. It's not ideal, but when I copy the value, I do get a string version of the value if they couldn't return me the object like Date or ObjectId.

Note : this behaviour also happen when I work with ObjectId() which return empty object. I would prefer having the string, but I don't know if this is out of scope because it's 3rd party.

@roblourens
Copy link
Member

vscode-debugadapter-fa49ce5e.json.gz

@connor4312 this is pausing after the code above and using "Copy Value" on the $gte property in the variables view. We evaluate x.$and[0].renewalDate.$gte, and js-debug returns an empty object. But evaluating the same thing in the debug console returns the expected string. I think this is relying on the toString behavior of Date

@roblourens roblourens assigned connor4312 and unassigned roblourens Oct 5, 2022
@connor4312 connor4312 added bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues labels Oct 5, 2022
@connor4312 connor4312 added this to the October 2022 milestone Oct 5, 2022
@aeschli
Copy link
Contributor

aeschli commented Oct 25, 2022

I still see the same in
Version: 1.73.0-insider (user setup)
Commit: a803dc3
Date: 2022-10-25T05:18:55.889Z
OS: Windows_NT x64 10.0.22623

const x = {
    $and: [
      {
        renewalDate: {
          $gte: new Date("2022-10-05T04:00:00.000Z"),
          $lte: new Date("2022-11-05T03:59:59.999Z"),
        },
      },
    ],
  };

console.log(x);
  • set break point at console.log, run the programm
  • when stopped at breakpoint, select x in the variables view, run Copy as value from the context menu
  • paste the content
{
  $and: [
    {
      renewalDate: {
        $gte: {
        },
        $lte: {
        },
      },
    },
  ],
}

@aeschli aeschli reopened this Oct 25, 2022
@aeschli aeschli added the verification-found Issue verification failed label Oct 25, 2022
@aeschli
Copy link
Contributor

aeschli commented Oct 25, 2022

Oh, I was not on JavaScript Debugger (Nightly)

Works with JavaScript Debugger (Nightly) v2022.10.1817

@aeschli aeschli closed this as completed Oct 25, 2022
@aeschli aeschli added verified Verification succeeded and removed verification-found Issue verification failed labels Oct 25, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Dec 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants