mirror of
https://github.com/getpaseo/paseo.git
synced 2026-07-29 12:01:31 +00:00
fix(projects): resolve legacy mutation aliases
This commit is contained in:
@@ -52,6 +52,19 @@ describe("project settings target", () => {
|
||||
expect(first).not.toBe(second);
|
||||
});
|
||||
|
||||
it("preserves whitespace in opaque project IDs", () => {
|
||||
const withoutTrailingSpace = resolveHostProjectSettingsRouteKey({
|
||||
serverId: "host-a",
|
||||
projectId: "/repo/foo",
|
||||
});
|
||||
const withTrailingSpace = resolveHostProjectSettingsRouteKey({
|
||||
serverId: "host-a",
|
||||
projectId: "/repo/foo ",
|
||||
});
|
||||
|
||||
expect(withTrailingSpace).not.toBe(withoutTrailingSpace);
|
||||
});
|
||||
|
||||
it("prefers an online host for a generic grouped settings route", () => {
|
||||
const groupedProject = {
|
||||
projectKey: "remote:github.com/acme/app",
|
||||
|
||||
@@ -9,8 +9,8 @@ export function resolveHostProjectSettingsRouteKey(host: {
|
||||
serverId: string;
|
||||
projectId?: string;
|
||||
}): string | null {
|
||||
const projectId = host.projectId?.trim();
|
||||
if (!projectId) return null;
|
||||
const projectId = host.projectId;
|
||||
if (!projectId?.trim()) return null;
|
||||
return frameHostProjectKey({ serverId: host.serverId, projectId });
|
||||
}
|
||||
|
||||
|
||||
@@ -170,6 +170,7 @@ export function normalizeWorkspaceDescriptor(
|
||||
return {
|
||||
id: normalizeWorkspaceOpaqueId(payload.id) ?? payload.id,
|
||||
projectId: payload.projectId,
|
||||
// COMPAT(projectKey): added in v0.2.4 on 2026-07-29; remove after 2027-01-29.
|
||||
projectKey: payload.projectKey ?? payload.project?.projectKey ?? null,
|
||||
projectDisplayName: payload.projectDisplayName,
|
||||
projectCustomName: payload.projectCustomName ?? null,
|
||||
|
||||
Reference in New Issue
Block a user