export function importIssuePageKey(runId: string, page: number): string { return `${runId}:${page}`; } export function matchesImportIssuePage(loadedRunId: string, loadedPage: number, runId: string, page: number): boolean { return loadedRunId === runId && loadedPage === page; } export async function runImportPollFollowup( runId: string, isCurrent: (runId: string) => boolean, followup: () => Promise, ): Promise<{ started: false; current: false } | { started: true; current: boolean; value: T }> { if (!isCurrent(runId)) return { started: false, current: false }; const value = await followup(); return { started: true, current: isCurrent(runId), value }; }