GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Remove workaround for fixed invalid json array deserializing bug by adamgauthier · Pull Request #8346 · PowerShell/PowerShell Conversation
Contributor
PR SummaryThis PR removes a workaround that was added because of a bug in the underlying json deserializing library Newtonsoft.Json. It is no longer required as the bug has been fixed in Newtonsoft.Json 10.0.3, see fix here. This workaround was added in #3823 and involves using a regex to detect a json array and calling Current behaviorPS D:\> ConvertFrom-Json '["1",' ConvertFrom-Json : Conversion from JSON failed with error: Unexpected end of content while loading JArray. Path '[0]', line 1, position 5. At line:1 char:1 + ConvertFrom-Json '["1",' + ~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [ConvertFrom-Json], ArgumentException + FullyQualifiedErrorId : System.ArgumentException,Microsoft.PowerShell.Commands.ConvertFromJsonCommand After workaround removalPS D:\> ConvertFrom-Json '["1",' ConvertFrom-Json : Conversion from JSON failed with error: Unexpected end when reading token. Path ''. At line:1 char:1 + ConvertFrom-Json '["1",' + ~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [ConvertFrom-Json], ArgumentException + FullyQualifiedErrorId : System.ArgumentException,Microsoft.PowerShell.Commands.ConvertFromJsonCommand PR Checklist
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Adam Gauthier (adamgauthier)
requested review from
James Truher (JamesWTruher) and
Paul Higinbotham (PaulHigin)
as code owners
Paul Higinbotham (PaulHigin)
suggested changes
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add a test to ensure the expected exception is thrown on invalid array.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Ilya (iSazonov)
approved these changes
Paul Higinbotham (PaulHigin)
approved these changes
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. LGTM
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Collaborator
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
|
There was an error while loading. Please reload this page.
|
It looks to me this PR causes the following feature-level test to fail: Lines 1446 to 1459 in 3794a5e
This PR didn't have [feature] tag in commit message, so the feature-level tests didn't run. Here is the failure: Affected CIs: Linux CI: https://powershell.visualstudio.com/PowerShell/_build/results?buildId=7147 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
We already had feature tests for this case and they are failing after the removal of the workaround. I'm reverting the change. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…rializing bug (PowerShell#8346)" This reverts commit 60a4e2f.
There was an error while loading. Please reload this page.
|
I'm sorry about this inconvenience, I was not aware of the existence of this particular test and should have been. I debugged this issue locally as soon as I could, the new error is caused by yet another Sorry again. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Adam Gauthier (@louistio) No problem, things happen. To automatically run the tests, prefix the last commit with |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Oh, seems we need re-pack our tests or at least update the code comment. Adam Gauthier (@louistio) Could you please make PR and update the comment with new information? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…8377) This is a follow up to reverted PR #8346. I removed a workaround that was used to avoid [a Newtonsoft.Json bug](JamesNK/Newtonsoft.Json#1321) that caused some incomplete json array input to successfully be deserialized. This bug being fixed, I thought the workaround was unnecessary, but after the merge some feature tests started to fail (which I did not run prior to merging). It was discovered that the workaround is still needed because while the first Newtonsoft.Json bug was fixed, some cases of incomplete json array input still behave unexpectedly, namely json input `[`. This PR is just to update the comment explaining the workaround so it links to the newly created issue [here](JamesNK/Newtonsoft.Json#1930).
…bug (PowerShell#8346)" (PowerShell#8375) Revert "Remove workaround for fixed invalid json array deserializing bug (PowerShell#8346)" This reverts commit fbe7090. This change caused the test which verified the functionality this workaround enabled, to start failing
…owerShell#8377) This is a follow up to reverted PR PowerShell#8346. I removed a workaround that was used to avoid [a Newtonsoft.Json bug](JamesNK/Newtonsoft.Json#1321) that caused some incomplete json array input to successfully be deserialized. This bug being fixed, I thought the workaround was unnecessary, but after the merge some feature tests started to fail (which I did not run prior to merging). It was discovered that the workaround is still needed because while the first Newtonsoft.Json bug was fixed, some cases of incomplete json array input still behave unexpectedly, namely json input `[`. This PR is just to update the comment explaining the workaround so it links to the newly created issue [here](JamesNK/Newtonsoft.Json#1930).
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.