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

fix(dontet): iso-8601 date strings get turned into DateTime #2058

Merged
merged 4 commits into from
Sep 29, 2020

Conversation

RomainMuller
Copy link
Contributor

@RomainMuller RomainMuller commented Sep 29, 2020

When a ISO-8601-encoded date is passed from JavaScript to the .NET app,
the JSON deserializer would interpret that as a DateTime instead of
passing the string un-touched. This is a problem, since the jsii kernel
protocol has a dedicated wrapper key for DateTime values ($jsii$date).

This PR adds a compliance test around this particular scenario, and
disabled DateTime handling from the standard deserializer (the wrapped
values are still processed correctly).

This PR also changes the way the .NET test package generates the
tested libraries (jsii-calc & dependencies) so that instead of
generating NuGet packages, it only generates C# projects. This makes
the experience of debugging the tests much nicer, and reduces the
likelihood of cached build artifacts getting in the way.

Fixes aws/aws-cdk#10513


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@RomainMuller RomainMuller added bug This issue is a bug. language/dotnet Related to .NET bindings (C#, F#, ...) effort/small Small work item – less than a day of effort p1 pr/do-not-merge This PR should not be merged at this time. module/runtime Issues affecting the `jsii-runtime` contribution/core This is a PR that came from AWS. labels Sep 29, 2020
@RomainMuller RomainMuller added this to the September Release milestone Sep 29, 2020
@RomainMuller RomainMuller requested a review from a team September 29, 2020 09:11
@RomainMuller RomainMuller self-assigned this Sep 29, 2020
@RomainMuller RomainMuller removed the pr/do-not-merge This PR should not be merged at this time. label Sep 29, 2020
When a ISO-8601-encoded date is passed from JavaScript to the .NET app,
the JSON deserializer would interpret that as a `DateTime` instead of
passing the string un-touched. This is a problem, since the jsii kernel
protocol has a dedicated wrapper key for DateTime values (`$jsii$date`).

This PR adds a compliance test around this particular scenario, and
disabled `DateTime` handling from the standard deserializer (the wrapped
values are still processed correctly).

> This PR also changes the way the .NET test package generates the
> tested libraries (`jsii-calc` & dependencies) so that instead of
> generating NuGet packages, it only generates C# projects. This makes
> the experience of debugging the tests **much** nicer, and reduces the
> likelihood of cached build artifacts getting in the way.

This bug was identified in aws/aws-cdk#10513
@RomainMuller RomainMuller force-pushed the rmuller/dotnet-date-callback branch from f337b15 to f73c6f8 Compare September 29, 2020 09:37
@aws aws deleted a comment from aws-cdk-automation Sep 29, 2020
eladb
eladb previously requested changes Sep 29, 2020
packages/@jsii/dotnet-runtime-test/generate.sh Outdated Show resolved Hide resolved
Co-authored-by: Elad Ben-Israel <benisrae@amazon.com>
@RomainMuller RomainMuller requested a review from eladb September 29, 2020 09:48
@RomainMuller RomainMuller dismissed eladb’s stale review September 29, 2020 10:29

Change was opted in :)

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-Blkkw9bQFn8A
  • Commit ID: 18a89a0
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@RomainMuller RomainMuller merged commit 52d7382 into master Sep 29, 2020
@RomainMuller RomainMuller deleted the rmuller/dotnet-date-callback branch September 29, 2020 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. contribution/core This is a PR that came from AWS. effort/small Small work item – less than a day of effort language/dotnet Related to .NET bindings (C#, F#, ...) module/runtime Issues affecting the `jsii-runtime` p1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[QLDB] Unable to create QLDB Stream in .NET
4 participants