Comments (7)
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?
from amplify-swift.
Hi @lawmicha
Amplify.Publisher.create(Amplify.DataStore.observe(model))
Amplify.Storage.uploadFile
orAmplify.Storage.uploadData
try await Amplify.DataStore.save(model)
- Received changes.mutationType "create" ==> this is correct on 2.29.2 which same to 2.17
- delete such content by API on client or on web and mask datastore one fileld to "deleted" status by the below iOS code:
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)")
- we can see this content is be deleted, but we can not receive changes.mutationType "update" event on 2.29.2, but 2.17 can receive
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!
from amplify-swift.
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.
from amplify-swift.
Hi @lawmicha
add more information, I rollback SDK version to 2.26.1; this issue will not happen.
from amplify-swift.
Hi @smediomike,
We've recently addressed an issue that was causing network-related problems in the latest version 2.33.3.
Would you mind please upgrading to this version and verifying if it also addresses your issue?
Thanks!
from amplify-swift.
Related Issues (20)
- Crash when saving data using datastore HOT 7
- pod Amplify 版本不支持 HOT 9
- 我自己能不能为Amplify v2支持CocoaPods? HOT 2
- AwsCommonRuntimeKit potentially needs a privacy manifest HOT 6
- AWS Amplify v2 fetchAuthSession returns isSignedIn False in Swift : After migrating Amplify v1 to v2 in iOS Swift, on app reopening HOT 5
- Login with Microsoft AD authentication using signInWithWebUI is not successful. HOT 1
- Improve login/logout with Google experience. HOT 3
- File at path does not exist HOT 10
- Update SQLite.swift HOT 5
- build error on xcode15.3 HOT 8
- Update `aws-sdk-swift` dependency to v0.42.0 HOT 2
- Crash in OutgoingMutationQueue.doStart(api:mutationEventPublisher:reconciliationQueue:) HOT 3
- Login fails post logout after First Successful signup/signin HOT 6
- amplifyconfiguration.json & awsconfiguration.json not updating when switching amplify environments HOT 5
- Login can not switch another google account HOT 3
- Amplify.Auth.signInWithWebUI Hang and always return time out, because authZState always return error HOT 9
- High Memoey leak HOT 4
- Amplify API Unathorized error Error HOT 29
- `HostedUIASWebAuthenticationSession.showHostedUI` never calls the continuation when `aswebAuthenticationSession.canStart` is false HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from amplify-swift.