feature/IO-3000-messaging-sockets-migration2 -

- Various work

Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
Dave Richer
2024-11-28 09:57:35 -08:00
parent 08c0da1bed
commit db5740d487
5 changed files with 40 additions and 9 deletions

View File

@@ -346,8 +346,13 @@ export const registerMessagingHandlers = ({ socket, client }) => {
client.cache.modify({
id: client.cache.identify({ __typename: "conversations", id: conversationId }),
fields: {
job_conversations: (existing = [], { readField }) =>
existing.filter((jobRef) => readField("jobid", jobRef) !== fields.jobId)
job_conversations: (existing = [], { readField }) => {
return existing.filter((jobRef) => {
// Read the `jobid` field safely, even if the structure is normalized
const jobId = readField("jobid", jobRef);
return jobId !== fields.jobId;
});
}
}
});
break;