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
can not receive update Subscription event on 2.29.2 SDK version #3632
Comments
Hi @smediomike, can you clarify with which API calls you making? In step 3. upload such picture to s3 storage, how do you upload the S3 picture, through Amplify.Storage.upload? And where/how is the mutation sent for the client to receive the subscription event? |
Hi @lawmicha
let s3Dict = [ "roomId" : room,
"s3_key_filename" : fileName as Any,
"s3_key" : content.s3_data as Any] as [String : Any]
jsonDict = [ "variables" : s3Dict,
"query" : "mutation Mark_delete_cloud_backup_ImageVideo($s3_key: String!) {\n mark_delete_cloud_backup_ImageVideo(s3_key: $s3_key) {\n userId\n album\n dateAdded\n dateBackup\n dateModified\n dateTaken\n deviceId\n duration\n hash\n height\n id\n isdeleted\n localPath\n mimeType\n orientation\n roomId\n s3Data\n size\n title\n tn1S3Data\n tn2S3Data\n type\n width\n createdAt\n updatedAt\n _version\n _deleted\n _lastChangedAt\n }\n}\n"
] as [String : Any]
var jsonData : Data? = nil;
do {
jsonData = try JSONSerialization.data(withJSONObject: jsonDict as Any, options: .prettyPrinted)
}catch {
}
let request = RESTRequest(apiName:"dataStoreApi",path: nil, body: jsonData)
let data = try await Amplify.API.post(request: request)
let str = String(decoding: data, as: UTF8.self)
print("mark delete Success: \(str)")
Note: this issue only happen iOS application go to background and then back to foreground. if application always keep in foreground, this issue will not happen. I will check more whether we need to step #1 again if application go to background before. thanks for your help! |
Hi @lawmicha add more information, I cancel old Subscription and add new Subscription after go to foreground, this issue still happen. BTW, once happen this issue, this "update" record will not be sync to local datastore till to re-start application. |
Hi @lawmicha |
Hi @smediomike, We've recently addressed an issue that was causing network-related problems in the latest version 2.33.3. Thanks! |
Describe the bug
after upgrade to 2.92.2, iOS application can not receive update Subscription if application switch to background before. 2.17 SDK version is okay.
Steps To Reproduce
Expected behavior
Application switch to background and then go to foreground, it should can receive update/delete Subscription event.
Amplify Framework Version
2.29.2
Amplify Categories
DataStore
Dependency manager
Swift PM
Swift version
5.0
CLI version
12.1.1
Xcode version
15.3
Relevant log output
Subscription received mutation: MutationEvent(id: "090D92A4-0B9F-40A4-AF48-E59D9E189784", modelId: "5A727AAF-B629-42FE-9242-70779BB7D5CD", modelName: "ImageVideo", json: "{\"album\":\"IMG_2367.PNG\",\"dateAdded\":\"2024-04-25T09:09:59.000Z\",\"dateBackup\":\"2024-04-25T09:14:02.818Z\",\"dateModified\":\"2024-04-25T09:10:00.094Z\",\"dateTaken\":\"2024-04-25T09:09:59.000Z\",\"duration\":0,\"hash\":\"8a55a76fd67c92b9f68846f6a7e3b190\",\"height\":2436,\"id\":\"5A727AAF-B629-42FE-9242-70779BB7D5CD\",\"isdeleted\":true,\"localPath\":\"IMG_2367.PNG\",\"mimeType\":\"image\\/png\",\"orientation\":1,\"roomId\":\"2\",\"s3Data\":\"2\\/image_video\\/8a55a76fd67c92b9f68846f6a7e3b190.PNG\",\"size\":\"6708712\",\"title\":\"IMG_2367.PNG\",\"tn1S3Data\":\"2\\/tn\\/image_video\\/8a55a76fd67c92b9f68846f6a7e3b190_web.jpg\",\"type\":2,\"updatedAt\":\"2024-04-25T09:14:02.818Z\",\"userId\":\"ap-northeast-1:e1e5ac7d-281f-4da8-bef9-cc71f42b17fc\",\"width\":1125}", mutationType: "update", createdAt: Amplify.Temporal.DateTime(foundationDate: 2024-04-25 09:14:03 +0000, timeZone: Optional(GMT (fixed))), version: Optional(2), inProcess: false, graphQLFilterJSON: nil) now we can not receive such above Subscription if before application go to background.
Is this a regression?
Yes
Regression additional context
2.17 SDK do not happen such issue.
Platforms
iOS
OS Version
16.0~17.3
Device
iPhoneX/iPhone XR
Specific to simulators
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: