Prevent stale session overwrite on new tasks
This commit is contained in:
@@ -50,6 +50,13 @@ export function clearActiveSessionId() {
|
||||
);
|
||||
}
|
||||
|
||||
export function createLocalSessionId() {
|
||||
if (typeof crypto !== "undefined" && "randomUUID" in crypto) {
|
||||
return `__LOCALID_${crypto.randomUUID().replace(/-/g, "").slice(0, 8)}`;
|
||||
}
|
||||
return `__LOCALID_${Math.random().toString(36).slice(2, 10)}`;
|
||||
}
|
||||
|
||||
export function writePendingWorkspaceSessionId(
|
||||
sessionId: string | null | undefined,
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user