Skip to content

Conversation

ragingsquirrel3
Copy link
Contributor

Addresses #2548

With the latest version of the CLI, new backends have CPK enabled by default. This changes the output of codegen in a way that breaks model helpers. Model helpers look for a field .targetName on schema fields in a few places when getting info from related models.

This PR does not add full support for CPK, just keeps model helpers working with new versions of CLI.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@ragingsquirrel3 ragingsquirrel3 requested a review from a team as a code owner January 9, 2023 22:52
@ragingsquirrel3 ragingsquirrel3 changed the title fix(api): model helpers can use targetNames in schemas with CPK enabled fix(api): model helpers use targetNames in schemas with CPK enabled Jan 9, 2023
HuiSF
HuiSF previously approved these changes Jan 9, 2023
HuiSF
HuiSF previously approved these changes Jan 9, 2023
dnys1
dnys1 previously approved these changes Jan 9, 2023
@dnys1 dnys1 enabled auto-merge (squash) January 12, 2023 17:26
@dnys1 dnys1 dismissed stale reviews from HuiSF and themself via 26de77c January 12, 2023 17:36
@dnys1 dnys1 merged commit 809190c into aws-amplify:main Jan 12, 2023
dnys1 pushed a commit to dnys1/amplify-flutter that referenced this pull request Jan 12, 2023
…ws-amplify#2559)

* fix(api): model helpers can use targetNames in schemas with CPK enabled

* address some comments
dnys1 pushed a commit to dnys1/amplify-flutter that referenced this pull request Jan 12, 2023
- fix(datastore): prevent unhandled exception crashing App rebuilding sync expression (aws-amplify#2549)
- fix(datastore): Upgrading from Datastore 0.6.1 to 0.6.8 causes Android app to crash (aws-amplify#2556)
- fix(api): model helpers use targetNames in schemas with CPK enabled (aws-amplify#2559)

- 160674d
- 7121ebc
- 957d6b4
- 5ec55b9
- 33df283
- 5ec023b
- 51f5e56
- fab55ae
- 6bd4182
- 6464555
- 2a7caae
- 809190c
@dnys1 dnys1 mentioned this pull request Jan 12, 2023
dnys1 pushed a commit that referenced this pull request Jan 12, 2023
…2559)

* fix(api): model helpers can use targetNames in schemas with CPK enabled

* address some comments
dnys1 pushed a commit that referenced this pull request Jan 12, 2023
- fix(datastore): prevent unhandled exception crashing App rebuilding sync expression (#2549)
- fix(datastore): Upgrading from Datastore 0.6.1 to 0.6.8 causes Android app to crash (#2556)
- fix(api): model helpers use targetNames in schemas with CPK enabled (#2559)

- 160674d
- 7121ebc
- 957d6b4
- 5ec55b9
- 33df283
- 5ec023b
- 51f5e56
- fab55ae
- 6bd4182
- 6464555
- 2a7caae
- 809190c
ragingsquirrel3 pushed a commit that referenced this pull request Jan 13, 2023
…2559)

* fix(api): model helpers can use targetNames in schemas with CPK enabled

* address some comments
dnys1 pushed a commit that referenced this pull request Jan 24, 2023
…2559)

* fix(api): model helpers can use targetNames in schemas with CPK enabled

* address some comments
dnys1 pushed a commit to Jordan-Nelson/amplify-flutter that referenced this pull request Jan 30, 2023
- fix(auth)!: Fetch Auth Session offline behavior ([aws-amplify#2585](aws-amplify#2585))

- fix(api): do not include null values in ModelMutations.create ([aws-amplify#2504](aws-amplify#2504))
- fix(api): model helpers use targetNames in schemas with CPK enabled ([aws-amplify#2559](aws-amplify#2559))
- fix(auth): Clear credentials before redirect on Web ([aws-amplify#2603](aws-amplify#2603))
- fix(auth): Refresh token in non-state machine calls ([aws-amplify#2572](aws-amplify#2572))
- fix(authenticator): ARB syntax ([aws-amplify#2560](aws-amplify#2560))
- fix(aws_common): AWSFile contentType getter should not throw exception
- fix(datastore): prevent unhandled exception crashing App rebuilding sync expression
- fix(storage): incorrect transferred bytes emitted from upload task

- feat(analytics): Legacy data migration of Pinpoint Endpoint ID ([aws-amplify#2489](aws-amplify#2489))
- feat(smithy_aws): add copyWith to S3ClientConfig
- feat(storage): allow configuring transfer acceleration

Updated-Components: Amplify Flutter, Amplify Dart, Amplify UI, DB Common, Secure Storage, AWS Common, Smithy, Worker Bee
dnys1 pushed a commit to Jordan-Nelson/amplify-flutter that referenced this pull request Jan 30, 2023
- fix(auth)!: Fetch Auth Session offline behavior ([aws-amplify#2585](aws-amplify#2585))

- fix(api): do not include null values in ModelMutations.create ([aws-amplify#2504](aws-amplify#2504))
- fix(api): model helpers use targetNames in schemas with CPK enabled ([aws-amplify#2559](aws-amplify#2559))
- fix(auth): Clear credentials before redirect on Web ([aws-amplify#2603](aws-amplify#2603))
- fix(auth): Refresh token in non-state machine calls ([aws-amplify#2572](aws-amplify#2572))
- fix(authenticator): ARB syntax ([aws-amplify#2560](aws-amplify#2560))
- fix(aws_common): AWSFile contentType getter should not throw exception
- fix(datastore): prevent unhandled exception crashing App rebuilding sync expression
- fix(storage): incorrect transferred bytes emitted from upload task

- feat(analytics): Legacy data migration of Pinpoint Endpoint ID ([aws-amplify#2489](aws-amplify#2489))
- feat(smithy_aws): add copyWith to S3ClientConfig
- feat(storage): allow configuring transfer acceleration

Updated-Components: Amplify Flutter, Amplify Dart, Amplify UI, DB Common, Secure Storage, AWS Common, Smithy, Worker Bee
Jordan-Nelson added a commit that referenced this pull request Jan 30, 2023
* chore(repo): Update component definition

Adds `amplify_api_dart` to the mix and creates components for DB Common, Secure Storage, and AWS Common

* fix(aft): Update changelog logic

For the version commit message changelog, only include publishable packages. Also updates base ref logic to ensure packages can be moved in and out of components.

* chore(version): Bump version

- fix(auth)!: Fetch Auth Session offline behavior ([#2585](#2585))

- fix(api): do not include null values in ModelMutations.create ([#2504](#2504))
- fix(api): model helpers use targetNames in schemas with CPK enabled ([#2559](#2559))
- fix(auth): Clear credentials before redirect on Web ([#2603](#2603))
- fix(auth): Refresh token in non-state machine calls ([#2572](#2572))
- fix(authenticator): ARB syntax ([#2560](#2560))
- fix(aws_common): AWSFile contentType getter should not throw exception
- fix(datastore): prevent unhandled exception crashing App rebuilding sync expression
- fix(storage): incorrect transferred bytes emitted from upload task

- feat(analytics): Legacy data migration of Pinpoint Endpoint ID ([#2489](#2489))
- feat(smithy_aws): add copyWith to S3ClientConfig
- feat(storage): allow configuring transfer acceleration

Updated-Components: Amplify Flutter, Amplify Dart, Amplify UI, DB Common, Secure Storage, AWS Common, Smithy, Worker Bee

---------

Co-authored-by: Dillon Nys <[email protected]>
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.

3 participants