mirror of
https://github.com/getpaseo/paseo.git
synced 2026-11-06 08:24:46 +00:00
Random host-local project IDs had replaced the persisted cross-host value carried by projectKey. Keep projectId for routing while reconciliation owns and persists projectKey for grouping.
16 lines
712 B
TypeScript
16 lines
712 B
TypeScript
export function resolveProjectKey(input: {
|
|
serverId: string;
|
|
projectId: string;
|
|
projectKey?: string | null;
|
|
}): string {
|
|
if (input.projectKey) return input.projectKey;
|
|
// COMPAT(projectKey): added in v0.2.4 on 2026-07-28; remove after 2027-01-28.
|
|
// Older daemons used remote/path-shaped project IDs as their grouping key. New opaque IDs
|
|
// must remain host-local when the new field is absent.
|
|
return input.projectId.startsWith("prj_") ? frameHostProjectKey(input) : input.projectId;
|
|
}
|
|
|
|
export function frameHostProjectKey(input: { serverId: string; projectId: string }): string {
|
|
return `host:${input.serverId.length}:${input.serverId}:project:${input.projectId.length}:${input.projectId}`;
|
|
}
|