-
Notifications
You must be signed in to change notification settings - Fork 198
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
MutationEvent.decodeModel don't decode LazyReference on delete mutation #3252
Comments
Thanks for opening the issue. Our team will look into it and provide an update on the issue. |
Hey @gbitaudeau .. Sorry for the delay. I wanted to ask you further if this is still a problem? I tried this on a latest version of Amplify and everything seems to be working fine. Adding of the post and comment.
Deleting of the comment
Following is my observe query snippet
Finally, I don't understand how when decoding a post in the comments with If this is still an issue, would you be able to share the entire code snippet end to end that has the problem so that I can further investigate the issue. Just FYI, I am using the latest version of Amplify Swift and Amplify CLI. Thanks. |
Hi @harsh62 , sorry, I try again on my side and the problem still occurs, but I didn't give you the right steps to reproduce it. Your code is good.
Hope with this you can reproduce it. |
@gbitaudeau I have a potential fix ready that seems to be working correctly for me. Would you be able to validate the fix on my working branch (named: |
Hi @harsh62 tests are ok on my side 👍 on your branch. |
@gbitaudeau A fix for the issue has been released in https://github.com/aws-amplify/amplify-swift/releases/tag/2.26.2. Thanks for your patience. |
|
Describe the bug
Consider the sample schema (given there : https://docs.amplify.aws/lib/datastore/relational/q/platform/ios/#updated-schema )
I use the LazyReference (using generatemodelsforlazyloadandcustomselectionset option for codegen)
When I use
Amplify.DataStore.observe
on Comment, if a comment is deleted, the post is not well set on it usingMutationEvent.decodeModel
, so there is no way to know which post lost a comment.Steps To Reproduce
Expected behavior
The LazyReference must load successfully using
let post = try await comment.post
Amplify Framework Version
2.19.0
Amplify Categories
DataStore
Dependency manager
Swift PM
Swift version
5.9
CLI version
12.4.0
Xcode version
15.0
Relevant log output
No response
Is this a regression?
No
Regression additional context
No response
Platforms
iOS
OS Version
iOS 17.0.1
Device
iPhone 14 Pro
Specific to simulators
No response
Additional context
I found a workaround in the generated
Comment.init(from decoder: Decoder)
, I replaced:with
And I added the following extension:
The text was updated successfully, but these errors were encountered: