Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

queued-edit-draft-key.ts

15 lines625 Bytes

1/**
2 * `<environmentId>:<threadId>~queued-edit~<runId>`: the marker holds no colon,
3 * so `composerDraftEnvironmentId` still reads the environment from the segment
4 * before the last colon and attachment uploads keep working, while the user's
5 * own draft for the thread stays untouched under its own key.
6 */
7const QUEUED_EDIT_DRAFT_MARKER = "~queued-edit~";
8​
9export function queuedEditDraftKey(threadKey: string, runId: string): string {
10 return `${threadKey}${QUEUED_EDIT_DRAFT_MARKER}${runId}`;
12​
13export function isQueuedEditDraftKey(draftKey: string): boolean {
14 return draftKey.includes(QUEUED_EDIT_DRAFT_MARKER);