-
Notifications
You must be signed in to change notification settings - Fork 247
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
Nullable connection fields prevent items from syncing to the cloud #558
Comments
Hey @anthonymoretti at the moment we don't support indexing your data with keys (https://docs.amplify.aws/cli/graphql-transformer/key) so your usage of @key(name: ..., fields: ....) could be leading to unexpected behavior though I'm not too sure why that would be the case ... Perhaps you can share some logs of what's happening? If you save other fields of Board, does it sync to cloud? We are planning on adding this feature in once the Amplify native Android and iOS libraries which we build upon support this feature! We can keep you informed of our progress on that. |
Hi @fjnoyp I thought using |
@fjnoyp Does this logging help? I wasn't sure if there were any sensitive fields so I removed several, if you need any that I removed let me know.
|
Thanks for sharing the logs @anthonymoretti This errors section looks interesting:
It seems to be complaining about the index key "secretaryId" being null. Have you tried saving a Board where all keys: byChair, byTreasurer, bySecretary are provided? |
@fjnoyp Yes I have and it syncs and that's what I'm doing for a workaround at the moment - I create a dummy Person and use it whenever the value should be null, but ideally I'd like to use nullable connections. |
@anthonymoretti right thanks for reiterating that. Your fields in Person appear to be required (!), could you try removing the ! and regenerating the codegen models?
|
@fjnoyp I just tried the changes you suggested but the same thing happens. Both Person and Board save locally but only Person syncs to the cloud. This is the schema I used:
|
This is a bug report I just filed that includes a couple of bugs I found and the workarounds to each |
Describe the bug
If nullable connection fields are present then some items save to DataStore but don't sync to the cloud.
To Reproduce
Steps to reproduce the behavior:
Person
, then save aBoard
with thePerson
as its chair:Person
item saved but theBoard
item didn't.Expected behavior
The
Board
item would also save to the cloud.Platform
Amplify Flutter current supports iOS and Android. This issue is reproducible in (check all that apply):
[ ] Android
[x] iOS
Output of
flutter doctor -v
Smartphone (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: