amplify-swift: can not receive update Subscription event on 2.29.2 SDK version
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
Steps to reproduce the behavior:
1, upgrade SDK to 2.29.2
2, run application and go to background to take one picture
3, upload such picture to s3 storage, as this time, we can receive Subscription Add event, and datastore also can query such new record.
4, delete this item from web by grpahcGL
5, iOS application can not receive such Subscription event; on 2.17 SDK, we can receive such event. and also datastore can not sync such record till to re-start application.
possible root cause:
our application go to background and then to foreground to upload and wait for update Subscription event. if we do not go to background and and do same steps, such issue do not happen.
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
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 32 (16 by maintainers)
Hi @tobias-feldmann ,
I’ve updated the branch
5d/network-availability-checkto restart the sync engine when the network is aborted. I tested it with a simple app, and it worked fine. Could you try it with your project to confirm if it mitigates the issue?