Skip to content

fix: support Ferdium server exports in the local account import - #2614

Open
Lars- wants to merge 1 commit into
ferdium:developfrom
Lars-:fix/2182-import-server-export
Open

Lars- wants to merge 1 commit into
ferdium:developfrom
Lars-:fix/2182-import-server-export

Conversation

@Lars-

@Lars- Lars- commented Nov 13, 2026

Copy link
Copy Markdown

Pre-flight Checklist

Please ensure you've completed all of the following.

Description of Change

Importing a file exported from a Ferdium server (like api.ferdium.org) into a local account failed with SQLITE_CONSTRAINT: NOT NULL constraint failed: services.recipeId and no services were created. The server serializes its models with snake_case keys (service_id, recipe_id), while _createAndCacheService() in the internal server only read serviceId and recipeId, which is the shape of the internal server's own export. It now reads both, the same way the import in ferdium-server already accepts service.recipe_id || service.recipeId. Reading service_id matters as well: with only the recipe key renamed (the workaround in the issue), the services are created but every workspace ends up with [null, null] instead of its services.

Tested with a new Jest test in test/internal-server/UserController.test.ts that imports a server export and an internal export and checks the recipe ids and the workspace service mapping; the first test fails without the change. The test lives in test/ because the Jest config ignores src/internal-server. I also ran pnpm typecheck, pnpm lint, pnpm biome:check, prettier and the full pnpm test, and started the internal server under Node with a stubbed electron module to post both formats to /transfer: before the change the server export failed with the same constraint error, after it the services and workspaces came through with the workspaces pointing to the new service ids. I did not run it in the packaged app.

Motivation and Context

Fixes #2182

Checklist

  • My pull request is properly named
  • The changes respect the code style of the project (pnpm prepare-code)
  • pnpm test passes

Release Notes

Exports from a Ferdium server can now be imported into a local account.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Importing settings into local account is not working

1 participant