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

Cannot update conflict resolution settings #1040

Open
2 tasks done
jo2 opened this issue Sep 23, 2023 · 15 comments
Open
2 tasks done

Cannot update conflict resolution settings #1040

jo2 opened this issue Sep 23, 2023 · 15 comments
Labels
bug An issue which has been identified as a bug data Data modelling studio-ui An issue that needs to be tracked by Studio Console team

Comments

@jo2
Copy link

jo2 commented Sep 23, 2023

How did you install the Amplify CLI?

npm

If applicable, what version of Node.js are you using?

18.16.0

Amplify CLI Version

12.5.0

What operating system are you using?

Windows

Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

No manual changes made

Describe the bug

I'm facing the issue, that Amplify Studio does not show my data model. Instead it displays an error message, that "New APIs created within Studio will now be configured with Conflict Resolution disabled by default. In order to use DataStore, this setting can be changed in the GraphQL API Settings page by selecting a conflict resolution option." When I activate Conflict Resolution, I can't hit save and deploy in Studio because that button is not displayed. As a solution I want to update this setting using the CLI.

To do so, I use amplify update api:

PS F:\git\kreinn\trackinn> amplify update api
? Select from one of the below mentioned services: GraphQL

General information
- Name: trackinn
- API endpoint: https://xxx.appsync-api.eu-central-1.amazonaws.com/graphql

Authorization modes
- Default: Amazon Cognito User Pool
- IAM

Conflict detection (required for DataStore)
- Conflict resolution strategy: Auto Merge

? Select a setting to edit Conflict resolution strategy  
? Select the default resolution strategy Auto Merge         
? Do you want to override default per model settings? No
⚠️ WARNING: owners may reassign ownership for the following model(s) and role(s): Payment: [owner], Invite: [owner], Booking: [owner], Staffing: [owner], Project: [owner], EmploymentRelationship: [owner], Employee: [owner], Cust
omer: [owner], Company: [owner]. If this is not intentional, you may want to apply field-level authorization rules to these fields. To read more: https://docs.amplify.aws/cli/graphql/authorization-rules/#per-user--owner-based-da
ta-access.
✅ GraphQL schema compiled successfully.

Edit your schema at F:\git\kreinn\trackinn\amplify\backend\api\trackinn\schema.graphql or place .graphql files in a directory at F:\git\kreinn\trackinn\amplify\backend\api\trackinn\schema
✅ Successfully updated resource

In my transform.conf.json I can see that this is set. When I then run amplify push the setting in Amplify Studio is still disabled.

Expected behavior

amplify update api in combination with amplify push should push the implemented changes to the cloud.

Reproduction steps

sadly, I can't reproduce this issue because in an other project everything works fine.

Project Identifier

7a15e020679dc93ffd0710267d909f36

Log output

# Put your logs below this line


Additional information

No response

Before submitting, please confirm:

  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
  • I have removed any sensitive information from my code snippets and submission.
@jo2 jo2 added the pending-triage An issue that is pending triage label Sep 23, 2023
@ykethan
Copy link
Member

ykethan commented Sep 25, 2023

Hey @jo2, thank you for reaching. tried reproducing the issue but did not observe this behavior.

Created a schema and pushed which disabled the save and deploy button, then used Amplify CLI to enable conflict resolution and push.
In the Studio application i refreshed the page and observed the Conflict resolution & offline capabilities enabled.
Could you let know if there are any additional information that could assist in reproducing the issue. For example, API configuration.

transferring the issue to studio repository.

@ykethan ykethan transferred this issue from aws-amplify/amplify-cli Sep 25, 2023
@ykethan ykethan added pending-response An issue is pending response from the issue requestor data Data modelling labels Sep 25, 2023
@jo2
Copy link
Author

jo2 commented Sep 25, 2023

Sadly, as I said, with another project I couldn't reproduce it myself. What kind of configuration information would help you, the cli-inputs.json or the backend-config.json for example?

@github-actions github-actions bot removed the pending-response An issue is pending response from the issue requestor label Sep 25, 2023
@ykethan
Copy link
Member

ykethan commented Sep 25, 2023

Hey @jo2, from the provided project identifier verified the cli-inputs.json, the file contains

"conflictResolution": {
      "defaultResolutionStrategy": {
        "type": "AUTOMERGE"
      }
    }

which indicates the conflict resolution is enabled. could provide us the following information.

  1. Check the S3 bucket managed by Amplify( for example: amplify-<project-name>-<envname>-93358-deployment) at path studio-backend/api/<project-name> for a transform.conf.json file containing the ResolverConfig block with the following
"ResolverConfig": {
        "project": {
            "ConflictHandler": "AUTOMERGE",
            "ConflictDetection": "VERSION"
        }
    }
  1. if the block is present, could you try opening the application in a inCognito window to confirm this.
  2. If the option does not still appear as enabled could you try pushing the API with a new empty line or a field and re-confirm the conflict resolution, do refresh the page once the amplify push finishes.

@ykethan ykethan added the pending-response An issue is pending response from the issue requestor label Sep 25, 2023
@jo2
Copy link
Author

jo2 commented Sep 26, 2023

Here is the content of the transform.conf.json of my environment:

{
    "Version": 5,
    "ElasticsearchWarning": true,
    "ResolverConfig": {
        "project": {
            "ConflictHandler": "AUTOMERGE",
            "ConflictDetection": "VERSION"
        }
    }
}

I ran the steps you've listed in your comment, I'm still facing the same issue.

@github-actions github-actions bot removed the pending-response An issue is pending response from the issue requestor label Sep 26, 2023
@ykethan
Copy link
Member

ykethan commented Sep 26, 2023

@jo2 interesting, this does provide the information that conflict resolution/Datastore has been enabled for the application.
Do you observe any errors in the browser debug window? this can be done by opening the GraphQL API settings page and the browser debug window then refresh the studio window while keeping the debug window open.

@ykethan ykethan added pending-response An issue is pending response from the issue requestor studio-ui An issue that needs to be tracked by Studio Console team labels Sep 26, 2023
@jo2
Copy link
Author

jo2 commented Sep 27, 2023

This is everything I got after refreshing the GraphQL API settings page:
image

@github-actions github-actions bot removed the pending-response An issue is pending response from the issue requestor label Sep 27, 2023
@ykethan
Copy link
Member

ykethan commented Sep 27, 2023

Hey @jo2, the info messages should not effect the conflict resolution.
Could you provide us the screenshot of the Data modelling API settings page and the data modelling page?
Are there any errors in the debug console on data modelling page?

@ykethan ykethan added the pending-response An issue is pending response from the issue requestor label Sep 27, 2023
@ykethan
Copy link
Member

ykethan commented Sep 27, 2023

additionally, could you ensure if the correct environment has been selected in studio. The a drop down list of env names should be present at the middle of the page.

@jo2
Copy link
Author

jo2 commented Sep 28, 2023

This is the content of the Data modeling page:
image

Allthough I have a data model it is not displayed here. Normally, the Data modeling UI is not shown because I'm using the @index directive in my GraphQL backend and I'm using an @auth groupsField. I'm expecting to see the GraphQL schema view, though, which happens in other projects in that case.

@github-actions github-actions bot removed the pending-response An issue is pending response from the issue requestor label Sep 28, 2023
@ykethan
Copy link
Member

ykethan commented Sep 28, 2023

Hey @jo2, could you try pulling the stg env into a new folder locally outside your existing project root and verify the backend/api/schema.graphql file. Does the file have the expected schema.
Additionally, would you be open for a quick call? I am available on discord at Eastern timezone. my handle is ykethan

@ykethan ykethan added the pending-response An issue is pending response from the issue requestor label Sep 28, 2023
@jo2
Copy link
Author

jo2 commented Sep 29, 2023

After running amplify pull --appId xxx --envName stg in an empty folder I receive the correct backend configuration. Both the schema.graphql and the transform.conf.json are as expected.

I'll contact you via discord for a meeting time.

@github-actions github-actions bot removed the pending-response An issue is pending response from the issue requestor label Sep 29, 2023
@ykethan
Copy link
Member

ykethan commented Sep 29, 2023

Hey @jo2, wanted to provide an update on this issue. I was successfully able to reproduce the issue. It appears the groupsField may be causing the Data modelling page to appear blank. From the network I was able to confirm that the schema is currently being pulled correctly and the Content such as Data manager does render the tables as well.

marking this as bug for further investigation.

@ykethan ykethan added bug An issue which has been identified as a bug and removed pending-triage An issue that is pending triage labels Sep 29, 2023
@jo2
Copy link
Author

jo2 commented Sep 30, 2023

Thanks! I'm looking forward to having this fixed.

Originally I stumbled over this because running amplify mock api no schema was available. This is what I'm seeing running amplify mock api in amplify cli 12.0.0. I'm not using the current version because of this issue.
image

I thought on checking up with the Amplify Studio Data modeling page, where I found that there was no schema either. Might this amplify mock issue being related to what I'm seeing in Amplify Studio?

@ykethan
Copy link
Member

ykethan commented Oct 2, 2023

@jo2 interesting, thank you for the information. The team will need to dive in further to see if the issue is due to the resolvers. Tested the Data manager but did not experience an sync issue on the model.

note:, diving into the browser network logs it does appear the schema in Data modelling is currently retrieved but no errors were logged.

@jo2
Copy link
Author

jo2 commented Oct 3, 2023

Thanks! Let me know if there is some additional information from my part you may need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue which has been identified as a bug data Data modelling studio-ui An issue that needs to be tracked by Studio Console team
Projects
None yet
Development

No branches or pull requests

2 participants