Working on iOS projects with AWS China service region. The AppSync Query/Mutation methods work well but no subscription method works. Looking into the network traffic detail, I found that the Amplify SDK mistakenly processes the realtime endpoint URL. Below is the block of source code that needs update:
All AWS China AppSync endpoints end with suffix amazonaws.com.cn, not amazonaws.com. Due to the code below, this will cause all AWS China AppSync real time endpoint to have one extra /realtime in the end. The following replacing name logic will also not run.
User can define the realtime endpoint in the amplifyconfig.json. Why not directly load it from the json instead of using such complex processing logic?
Describe the bug
Working on iOS projects with AWS China service region. The AppSync Query/Mutation methods work well but no subscription method works. Looking into the network traffic detail, I found that the Amplify SDK mistakenly processes the realtime endpoint URL. Below is the block of source code that needs update:
AmplifyPlugins/API/Sources/AWSAPIPlugin/SubscriptionFactory/AppSyncRealTimeClientFactory.swift
All AWS China AppSync endpoints end with suffix
amazonaws.com.cn
, notamazonaws.com
. Due to the code below, this will cause all AWS China AppSync real time endpoint to have one extra/realtime
in the end. The following replacing name logic will also not run.Steps To Reproduce
Expected behavior
User can define the realtime endpoint in the amplifyconfig.json. Why not directly load it from the json instead of using such complex processing logic?
Amplify Framework Version
2.44.0
Amplify Categories
API
Dependency manager
Swift PM
Swift version
5.8
CLI version
12.1.1
Xcode version
15.4
Relevant log output
No response
Is this a regression?
No
Regression additional context
No response
Platforms
iOS
OS Version
iOS 18.1
Device
iPad, iPhone
Specific to simulators
No response
Additional context
No response