fix(import): make effects and figure/clothing import work on deployment

- resolveGamedataFile: detect Windows drive/UNC paths explicitly instead of
  path.win32.isAbsolute (which is true for any /-prefixed path on Linux), so
  /nitro-assets URLs are no longer returned verbatim; add deployment gamedata
  root fallback (/var/www/Gamedata/config) and keep public/Gamedata/config.
- effect/figure import dirs now resolve via site settings then the gamedata
  root bundled dir, instead of hardcoded public paths.
- effect list falls back to the local EffectMap when the official habbo.com
  endpoint is unreachable, keeping the admin import page usable.
- update staff smoke contract for db:migrate and instant=false (Cache
  Components migration).
This commit is contained in:
openhands committed 2026-08-05 11:10:16 +02:00
1 parent 694a24c791
commit dd708a64fb
10 files changed
+172 -56

No files matched your search

+6
View File
@@ -4,6 +4,12 @@ import { describe, expect, it, vi } from "vitest";
vi.mock("@/lib/services/import/core/download", () => ({
downloadFile: vi.fn(async () => ({ ok: true, size: 100 })),
}));
vi.mock("@/lib/services/site-settings", () => ({
siteSettings: { get: vi.fn(async () => "") },
}));
vi.mock("@/lib/services/furni-asset-dirs", () => ({
getGamedataRoot: vi.fn(async () => ""),
}));
vi.mock("@/lib/services/effect-source", () => ({
resolveEffectSwfUrl: vi.fn(async (lib: string) => `https://x/${lib}.swf`),
listOfficialEffects: vi.fn(async () => []),