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

Re-Open #2945: AppSync realtime endpoint URL is not correct for AWS China regions #2957

Closed
1 task done
wulianer opened this issue Nov 26, 2024 · 4 comments
Closed
1 task done
Labels
bug Something isn't working pending-maintainer-response Issue is pending response from an Amplify team member

Comments

@wulianer
Copy link

wulianer commented Nov 26, 2024

Before opening, please confirm:

Language and Async Model

Kotlin

Amplify Categories

GraphQL API

Gradle script dependencies

// Put output below this line

Environment information

# Put output below this line


Please include any relevant guides or documentation you're referencing

No response

Describe the bug

The latest 2.24.1 release note claims that it fixes the bug in ticket #2945 but actually it still exists.

This is the AppSync Endpoint URL (good for query/mutation methods):

https://6zjgfa5z5zh4ndlhyz12345678.appsync-api.cn-northwest-1.amazonaws.com.cn

This is the realtime Endpoint that the SDK 2.24.1 tries to access:

wss://6zjgfa5z5zh4ndlhyz12345678.appsync-api.cn-northwest-1.amazonaws.com.cn/graphql//realtime

which is not correct. It returns 404 and causes subscription failure.

The correct URL should be sth like this:

wss://6zjgfa5z5zh4ndlhyz12345678.appsync-realtime-api.cn-northwest-1.amazonaws.com.cn/graphql

Reproduction steps (if applicable)

No response

Code Snippet

// Put your code below this line.

Log output

// Put your logs below this line


amplifyconfiguration.json

No response

GraphQL Schema

// Put your schema below this line

Additional information and screenshots

No response

@github-actions github-actions bot added pending-triage Issue is pending triage pending-maintainer-response Issue is pending response from an Amplify team member labels Nov 26, 2024
@wulianer wulianer changed the title Re-Open: AppSync realtime endpoint URL is not correct for AWS China regions Re-Open #2945: AppSync realtime endpoint URL is not correct for AWS China regions Nov 26, 2024
@tylerjroach
Copy link
Member

Thank you for the report. We will take a look

@tylerjroach tylerjroach added the bug Something isn't working label Nov 27, 2024
@github-actions github-actions bot removed pending-maintainer-response Issue is pending response from an Amplify team member pending-triage Issue is pending triage labels Nov 27, 2024
@vincetran
Copy link
Member

@wulianer Can you provide a code snippet showing how you configured the CN region? I verified that the regex correctly identifies https://6zjgfa5z5zh4ndlhyz12345678.appsync-api.cn-northwest-1.amazonaws.com.cn as a "standard" endpoint and should generate the appsync-realtime-api domain but for some reason it's hitting the "custom" endpoint logic.

The smoking gun is this part of the endpoint that it's trying to hit: /graphql//realtime

The URL of the endpoint when it goes into the regex should not have a trailing / -- if you tried to test https://6zjgfa5z5zh4ndlhyz12345678.appsync-api.cn-northwest-1.amazonaws.com.cn/graphql/ it would fail and generate wss://6zjgfa5z5zh4ndlhyz12345678.appsync-api.cn-northwest-1.amazonaws.com.cn/graphql//realtime

@vincetran vincetran added the pending-community-response Issue is pending response from the issue requestor label Dec 3, 2024
@wulianer
Copy link
Author

wulianer commented Dec 5, 2024

Thanks for the reply. Yes I did find the trailing / in my endpoint and after removing it, it works now.

@wulianer wulianer closed this as completed Dec 5, 2024
@github-actions github-actions bot added pending-maintainer-response Issue is pending response from an Amplify team member and removed pending-community-response Issue is pending response from the issue requestor labels Dec 5, 2024
Copy link
Contributor

github-actions bot commented Dec 5, 2024

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pending-maintainer-response Issue is pending response from an Amplify team member
Projects
None yet
Development

No branches or pull requests

3 participants