-
Notifications
You must be signed in to change notification settings - Fork 222
Open
Labels
apiIssues related to the API categoryIssues related to the API categorybugSomething isn't workingSomething isn't workingclosing soonThis issue will be closed in 7 days unless further comments are made.This issue will be closed in 7 days unless further comments are made.pending-community-responseIssue is pending response from the issue requestorIssue is pending response from the issue requestor
Description
Describe the bug
Application can not create subscribe once application go to background and then foreground. this issue did not happen on 2.17.1 and 2.26.1 SDK
Steps To Reproduce
1, start application
2, create Amplify.API.subscribe(request: .subscription(of: BroadcastMessage.self, type: .onUpdate))
3, when all initialized, go to background
4, wait for one 20 seconds
5, go to foreground
6, Subscription has terminated will happen
do {
for try await subscriptionEvent in messagesubscription {
} catch {
print("Subscription has terminated with \(error)")
}
7, after checked network status and subscribe status and restart this subscribe again
8, fail and can not create this subscribe again
Expected behavior
same to 2.26.1, application go to foreground, still can use subscribe or can create subscribe.
Amplify Framework Version
2.43.0
Amplify Categories
API, DataStore
Dependency manager
Swift PM
Swift version
5.0
CLI version
12.1.1
Xcode version
xcode16
Relevant log output
DataStoreIncomingAsyncSubscriptionEventPublisher] [InitializeSubscription.1] API.subscribe failed for `Document` error: WebSocketClient connection aborted\
Subscription has terminated with APIError: WebSocketClient connection aborted\
Recovery suggestion: WebSocketClient connection aborted\
Caused by:\
Error Domain=NSURLErrorDomain Code=-1005 "(null)"\
Is this a regression?
Yes
Regression additional context
2.17.1 and 2.26.1 are okay. our QA did such test, but 2.43.0 are always failed. 100% reproduce rate.
Platforms
iOS
OS Version
16.7/17.1/18.0
Device
iPhoneX/iPhone12/iPadPro
Specific to simulators
No response
Additional context
No response
Metadata
Metadata
Assignees
Labels
apiIssues related to the API categoryIssues related to the API categorybugSomething isn't workingSomething isn't workingclosing soonThis issue will be closed in 7 days unless further comments are made.This issue will be closed in 7 days unless further comments are made.pending-community-responseIssue is pending response from the issue requestorIssue is pending response from the issue requestor