Giter Site home page Giter Site logo

Comments (6)

NikaHsn avatar NikaHsn commented on June 2, 2024

@harrynguyen2510 thanks for taking the time to raise this issue. While we investigate could you please provide answers to the following questions:

  • did you run amplify codegen models after schema update?
  • do you get any error message when calling Amplify.Datastore.save, if so can you please share the logs?
  • dose Amplify.Datastore.save saves the data locally on the device?

from amplify-flutter.

harrynguyen2510 avatar harrynguyen2510 commented on June 2, 2024
  • yes I did, even to make sure, I delete Models folder and run command amplify codegen models
  • yes it saves normally and the subscription catches new data locally, but it does not sync to cloud

from amplify-flutter.

NikaHsn avatar NikaHsn commented on June 2, 2024

@harrynguyen2510 thanks for providing these info. Is this issue exclusive to iOS, or does it also happen in Android? could you please provide both the original and updated schemas?

from amplify-flutter.

harrynguyen2510 avatar harrynguyen2510 commented on June 2, 2024

I didn't test on Android, but I tested on 3 iOS devices, and it happened the same bug.

Here is current Schema
type User @model @auth(rules: [{allow: public}]) {
id: ID!
authenticateID: String!
username: String!
fullname: String!
email: String!
phonenumber: String
password: String
profilepicKey: String
bio: String
resign: Boolean
isDeveloperPermit: Boolean
isActive: Boolean
updateUserType: String
oneSignalID: [String]
updateOneSignalIDType: String
platform: String
deviceToken: [String]
updateDeviceTokenType: String
userPermission: [String]
updateUserPermissionType: String
authority: [String]
updateAuthorityType: String
followingUserids: [String]
updateFollowingType: String
followedbyUserids: [String]
updateFollowedbyType: String
createdAt: AWSDateTime
updatedAt: AWSDateTime
}

type EmployeeCode @model @auth(rules: [{allow: public}]) {
id: ID!
ecode: String!
name: String!
dob: String!
title: String!
confirmemail: Boolean
email: String
department: String!
connectUser: String
createdAt: AWSDateTime
updatedAt: AWSDateTime
}

type Member @model @auth(rules: [{allow: public}]) {
id: ID!
admin: Boolean
userID: String!
onChatroomid: String
onGroupid: String
updatedAt: AWSDateTime
createdAt: AWSDateTime
}

type FollowRelation @model @auth(rules: [{allow: public}]) {
id: ID!
followerID: String!
followeeID: String!
createdAt: AWSDateTime
updatedAt: AWSDateTime
}

type Chatroom @model @auth(rules: [{allow: public}]) {
id: ID!
chatgrouppickey: String
chatgroupName: String
isGroup: Boolean
lastupdateTime: String!
lastupdateDate: String!
createdbyUserID: String!
isDeleted: Boolean
updateType: String
adminID: [String]
updateAdminType: String
members: [String]
updateMemberType: String
isPinnedByUserIDs: [String]
updatePinType: String
isNewMessageForUserIDs: [String]
updateHaveNewMessageType: String
userIDsTyping: [String]
updateTypingType: String
createdAt: AWSDateTime
updatedAt: AWSDateTime
currentSeenByUserids: [String]
allowChangeUI: Boolean
lastMessage: String
lastMessageid: String
}

type MessageItem @model @auth(rules: [{allow: public}]) {
id: ID!
content: String
filekey: [String]
hasFile: Boolean
contenttype: String!
replyFromMessageid: String
sentbyUserID: String!
onChatroomID: String!
isforward: Boolean
isDeleted: Boolean
withPollID: String
isLastMessageOnRoom: Boolean
updateMessageType: String
reactedBy: [String]
updateReactType: String
currentlySeenBy: [String]
updateSeenType: String
savedby: [String]
updateSaveType: String
createdTime: String
createdDate: String
createdAt: AWSDateTime
updatedAt: AWSDateTime
}

type ReactionItem @model @auth(rules: [{allow: public}]) {
id: ID!
reactionType: String!
reactedbyUserID: String!
onMessageitemID: String!
onChatroomID: String!
createdAt: AWSDateTime
updatedAt: AWSDateTime
}

type SaveMessage @model @auth(rules: [{allow: public}]) {
id: ID!
savedbyUserID: String!
atMessageitemID: String!
onChatroomID: String!
createdAt: AWSDateTime
updatedAt: AWSDateTime
}

type GroupPost @model @auth(rules: [{allow: public}]) {
id: ID!
groupname: String!
grouppic: String
createdby: String!
updateGroupPostType: String
adminID: [String]
updateAdminType: String
members: [String]
updateMemberType: String
createdAt: AWSDateTime
updatedAt: AWSDateTime
}

type Post @model @auth(rules: [{allow: public}]) {
id: ID!
content: String!
filekey: [String]
hasFile: Boolean
withPollID: String
postedbyUserID: String!
postedonGroupID: String
isEdited: Boolean
updatePostType: String
pinDueDate: String
isPinDepartment: Boolean
isPinGlobal: Boolean
pinGlobalForSpecific: [String]
updatePinGlobalForSpecificType: String
likeByUserids: [String]
updateLikeType: String
savedby: [String]
updateSaveType: String
createdTime: String
craatedDate: String
createdAt: AWSDateTime
updatedAt: AWSDateTime
}

type Comment @model @auth(rules: [{allow: public}]) {
id: ID!
content: String
onPostid: String
commentedbyUserID: String
filekey: [String]
hasFile: Boolean
isEdited: Boolean
updateCommentType: String
likeByUserids: [String]
updateLikeType: String
createdAt: AWSDateTime
updatedAt: AWSDateTime
}

type Reply @model @auth(rules: [{allow: public}]) {
id: ID!
content: String
onCommentid: String
onPostid: String
repliedbyUserID: String
filekey: [String]
hasFile: Boolean
isEdited: Boolean
updateReplyType: String
likeByUserids: [String]
updateLikeType: String
createdAt: AWSDateTime
updatedAt: AWSDateTime
}

type PollContent @model @auth(rules: [{allow: public}]) {
id: ID!
createdByUserid: String!
title: String!
filekey: [String]
hasFile: Boolean
pollDueDate: String
allowSelect: Boolean!
mutipleSelect: Boolean
updatePollType: String
optionOne: String!
optionOneVoteByUserids: [String]
updateOptionOneType: String
optionTwo: String!
optionTwoVoteByUserids: [String]
updateOptionTwoType: String
optionThree: String
optionThreeVoteByUserids: [String]
updateOptionThreeType: String
optionFour: String
optionFourVoteByUserids: [String]
updateOptionFourType: String
optionFive: String
optionFiveVoteByUserids: [String]
updateOptionFiveType: String
createdAt: AWSDateTime
updatedAt: AWSDateTime
}

type Like @model @auth(rules: [{allow: public}]) {
id: ID!
onPostid: String
onCommentid: String
onReplyid: String
likedbyUserID: String
createdAt: AWSDateTime
updatedAt: AWSDateTime
}

type SavePost @model @auth(rules: [{allow: public}]) {
id: ID!
savedby: String
atPostid: String
createdAt: AWSDateTime
updatedAt: AWSDateTime
}

type Bell @model @auth(rules: [{allow: public}]) {
id: ID!
sentbyUserID: [String!]!
updateSentByType: String
toUserID: String!
belltype: String!
didRead: Boolean!
postid: String
commentid: String
replyid: String
groupid: String
createdAt: AWSDateTime
updatedAt: AWSDateTime
}

type AnonymousQuery @model @auth(rules: [{allow: public}]) {
id: ID!
content: String!
didRead: Boolean!
adminResponse: String
createdAt: AWSDateTime
updatedAt: AWSDateTime
}

type UserPermission @model @auth(rules: [{allow: public}]) {
id: ID!
key: String!
value: String!
forUserid: String!
createdAt: AWSDateTime
updatedAt: AWSDateTime
}

type UserAuthority @model @auth(rules: [{allow: public}]) {
id: ID!
userID: String!
authority: String!
createdAt: AWSDateTime
updatedAt: AWSDateTime
}

type SpecialObject @model @auth(rules: [{allow: public}]) {
id: ID!
type: String!
key: String!
value1: String!
value2: String
value3: String
value4: String
value5: String
value6: String
value7: String
value8: String
value9: String
value10: String
createdAt: AWSDateTime
updatedAt: AWSDateTime
}

type BugDetect @model @auth(rules: [{allow: public}]) {
id: ID!
userid: String!
bug: String!
createdAt: AWSDateTime
updatedAt: AWSDateTime
}

This is a schema I removed currently (did remove others some before, but worked normally)

type MediaFileRatio @model @auth(rules: [{allow: public}]) {
id: ID!
filekey: String!
ratio: Float!
}
I deleted all data on this model, then delete on schema.graphql, amplify codegen models, amplify push, then deploy on studio

Another question that I see some amplify flutter plugins are 2.0.0. Are these for Gen 2 or just upgrade version for Gen 1?
Thanks

from amplify-flutter.

NikaHsn avatar NikaHsn commented on June 2, 2024

@harrynguyen2510 thank you for providing these details. we will look into this issue and get back to you with any updates.

re: Another question that I see some amplify flutter plugins are 2.0.0. Are these for Gen 2 or just upgrade version for Gen 1?

The latest version of the Amplify Flutter library is 2.0.0, which currently supports Gen1 configurations through amplifyconfiguration.dart. you can use either Amplify Gen1 or Gen2 to setup your backend. With Amplify Gen2, you must use the --outputs-version 0 flag with ampx command. Development for supporting Gen2 with --outputs-version 1 is in progress, you can follow #4834 for update.

from amplify-flutter.

harrynguyen2510 avatar harrynguyen2510 commented on June 2, 2024

The cause of issue is that I mistakely change attribute name of schema model while the model on cloud, on that attribute, currently having values. So it was error for sync
Resolved by deleting these data of schema model in DynamoDB, then it works normally

from amplify-flutter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.