feature/IO-3000-messaging-sockets-migrations2 -

- Checkpoint,

Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
Dave Richer
2024-11-21 15:05:52 -08:00
parent 1cdd905037
commit cd592b671c
3 changed files with 28 additions and 3 deletions

View File

@@ -22,6 +22,7 @@ export const registerMessagingHandlers = ({ socket, client }) => {
query: CONVERSATION_LIST_QUERY,
variables: { offset: 0 }
});
client.cache.writeQuery({
query: CONVERSATION_LIST_QUERY,
variables: { offset: 0 },
@@ -49,7 +50,14 @@ export const registerMessagingHandlers = ({ socket, client }) => {
id: conversationId
}),
fields: {
updated_at: () => new Date(),
updated_at: () => new Date().toISOString(),
archived(cached) {
// Unarchive the conversation if it was previously marked as archived
if (cached) {
return false;
}
return cached;
},
messages_aggregate(cached) {
// Increment unread count only if the message is inbound
if (!isoutbound) {