Merged in release/2025-12-19 (pull request #2753)

Release/2025 12 19
This commit is contained in:
Dave Richer
2025-12-30 19:21:50 +00:00
17 changed files with 802 additions and 387 deletions

View File

@@ -148,6 +148,26 @@ const cache = new InMemoryCache({
Query: {
fields: {
// Note: This is required because we switch from a read to an unread state with a toggle,
conversations: {
keyArgs: ["where", "order_by"], // keep separate caches for archived/unarchived + sort
merge(existing = [], incoming = [], { args, readField }) {
const offset = args?.offset ?? 0;
const merged = existing ? existing.slice(0) : [];
for (let i = 0; i < incoming.length; i++) {
merged[offset + i] = incoming[i];
}
// Deduplicate by id (important when you also upsert via sockets)
const seen = new Set();
return merged.filter((ref) => {
const id = readField("id", ref);
if (!id || seen.has(id)) return false;
seen.add(id);
return true;
});
}
},
notifications: {
merge(existing = [], incoming = [], { readField }) {
// Create a map to deduplicate by __ref