Skip to content

Do not set calcNewSig to false in request #1056

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

Merged
merged 1 commit into from
Oct 5, 2021

Conversation

Mark-Simulacrum
Copy link
Member

Missed another spot where this needs adjusting...

stat: "instructions:u",
}, state);
values["calcNewSig"] = values.calcNewSig === 'true';
// Make sure we pass a boolean.
if (typeof values.calcNewSig === "string") {
Copy link
Member

Choose a reason for hiding this comment

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

Can you explain why we need to do this?

Copy link
Member Author

@Mark-Simulacrum Mark-Simulacrum Oct 5, 2021

Choose a reason for hiding this comment

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

I haven't verified, but I believe serde will fail to deserialize calcNewSig:"true" as a bool, so we need to force the conversion to boolean in JS for the case where it's set from the query parameters

Copy link
Member

Choose a reason for hiding this comment

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

Yea that seems true, but we were already setting calcNewSig to a bool. This seems to just conditionally set if it were previously a string. I'm just confused why we need to add this conditional.

Copy link
Member Author

Choose a reason for hiding this comment

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

Without this patch, values.calcNewSig is undefined (since it's not mentioned on the query string), and that is !== "true", so we get false and don't enable the new alg.

If it is mentioned, we need to "deserialize" it with the === "true" but if we do that unconditionally we'll end up setting it to false (since we've put a boolean in the map). I guess an alternative could be to put "true" in the default object here.

auto-merge was automatically disabled October 5, 2021 17:28

Pull request was closed

@Mark-Simulacrum Mark-Simulacrum merged commit f34edd5 into rust-lang:master Oct 5, 2021
@Mark-Simulacrum Mark-Simulacrum deleted the new-sig-default branch October 5, 2021 17:47
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