jesus-collective / mobile

Jesus Collective website and mobile app
https://www.jesuscollective.com
4 stars 2 forks source link

DMs: Performance improvements #277

Open JonEsparaz opened 4 years ago

JonEsparaz commented 4 years ago

Creating a new message room is painfully slow. This was mentioned in #243 (which was closed).

┆Issue is synchronized with this Wrike Task

GeorgeBellTMH commented 4 years ago

I think we can make a customMutation that merges more than one mutation into the same request. So createRoom(roomInfo, [users]) or something similar...

JonEsparaz commented 4 years ago

That's what I was thinking. Also, I think there's also a bottle neck loading all the messages. A @key directive to get rooms by userID is likely more performant than using filter: { userID: { eq: user['username'] } }.

GeorgeBellTMH commented 4 years ago

Sounds good...

JonEsparaz commented 4 years ago

I'm working on some VTL for a batch mutation.

GeorgeBellTMH commented 4 years ago

Let me know if that worked...

JonEsparaz commented 4 years ago

Doesn't look like it worked (returns [null, null]). I think the issue might be the table name.

Is the table actually named "DirectMessageUser" or "DirectMessageUser-long string of chars"?

GeorgeBellTMH commented 4 years ago

Yah, it has the long string of characters depending on which environment it is....

JonEsparaz commented 4 years ago

Can we try adding the full table name in the res/req files?

This post suggests that the full name is required: https://medium.com/@jan.hesters/creating-graphql-batch-operations-for-aws-amplify-with-appsync-and-cognito-ecee6938e8ee

Although the AWS Appsync docs I followed suggest otherwise: https://docs.aws.amazon.com/appsync/latest/devguide/tutorial-dynamodb-batch.html#permissions

lucastbelem commented 1 year ago

@itbel did you by chance do any of this as part of the DM improvement works?