(input: { sessionID: string; messageID: string })
| 1025 | setData("part", input.message.id, parts) |
| 1026 | }, |
| 1027 | remove(input: { sessionID: string; messageID: string }) { |
| 1028 | const item = optimistic.get(input.sessionID)?.get(input.messageID) |
| 1029 | if (!item) return |
| 1030 | messageLoads.get(input.sessionID)?.optimisticParts.delete(input.messageID) |
| 1031 | clearOptimistic(input.sessionID, input.messageID) |
| 1032 | if (item.confirmedMessage) { |
| 1033 | const partIDs = new Set(item.parts.map((part) => part.id)) |
| 1034 | setData( |
| 1035 | produce((draft) => { |
| 1036 | for (const part of item.parts) { |
| 1037 | delete draft.part_text_accum_delta[part.id] |
| 1038 | deltaBases.delete(part.id) |
| 1039 | } |
| 1040 | const parts = draft.part[input.messageID] |
| 1041 | if (!parts) return |
| 1042 | draft.part[input.messageID] = parts.filter((part) => !partIDs.has(part.id)) |
| 1043 | if (draft.part[input.messageID]?.length === 0) delete draft.part[input.messageID] |
| 1044 | }), |
| 1045 | ) |
| 1046 | return |
| 1047 | } |
| 1048 | setData("message", input.sessionID, (messages) => messages?.filter((message) => message.id !== input.messageID)) |
| 1049 | setData(produce((draft) => deleteMessageParts(draft, input.messageID))) |
| 1050 | }, |
| 1051 | }, |
| 1052 | diff(sessionID: string, options?: { force?: boolean }) { |
| 1053 | touch(sessionID) |
nothing calls this directly
no test coverage detected