fix(notification): cache parentID from session events to fix subtask notification detection (#530)

This commit is contained in:
Jovines
2026-02-27 09:32:20 +02:00
committed by GitHub
parent 27321d454b
commit 17734a6c65
+6 -1
View File
@@ -847,6 +847,11 @@ const maybeCacheSessionInfoFromEvent = (payload) => {
const sessionId = info.id;
const title = info.title;
cacheSessionTitle(sessionId, title);
// Also cache parentID from session events to ensure subtask detection works correctly
const parentID = info.parentID;
if (sessionId && parentID !== undefined) {
setCachedSessionParentId(sessionId, parentID);
}
};
/**
@@ -4170,7 +4175,7 @@ const fetchSessionParentId = async (sessionId) => {
}
const match = data.find((s) => s && typeof s === 'object' && s.id === sessionId);
const parentID = match && typeof match.parentID === 'string' && match.parentID.length > 0 ? match.parentID : null;
const parentID = match?.parentID ? match.parentID : null;
setCachedSessionParentId(sessionId, parentID);
return parentID;
} catch {