fix(migration): preserve and recover legacy desktop sources (#1550)

* fix(migration): recover legacy desktop sources without replacing current data

* test(migration): cover legacy recovery IPC contracts

* test(migration): use static legacy Electron bootstrap
This commit is contained in:
4gray authored and GitHub committed 2026-09-06 00:45:35 +02:00
1 parent 002faafbd7
commit 9bcdbc0efb
26 files changed
+1505 -38

No files matched your search

@@ -82,6 +82,18 @@ export const dbPreloadCases: PreloadInvokeCase[] = [
channel: 'DB_UPSERT_APP_PLAYLIST',
forwardedArgs: [playlist],
},
{
method: 'dbRecoverLegacyPlaylists',
args: [],
channel: 'DB_RECOVER_LEGACY_PLAYLISTS',
forwardedArgs: [],
},
{
method: 'dbMigrateAppPlaylists',
args: [playlists],
channel: 'DB_MIGRATE_APP_PLAYLISTS',
forwardedArgs: [playlists],
},
{
method: 'dbUpsertAppPlaylists',
args: [playlists],
@@ -750,6 +750,10 @@ const electronApi: ElectronBridgeApi = {
ipcRenderer.invoke('DB_GET_PLAYLIST', playlistId),
dbUpsertAppPlaylist: (playlist: Playlist, _operationId?: string) =>
ipcRenderer.invoke('DB_UPSERT_APP_PLAYLIST', playlist),
dbMigrateAppPlaylists: (playlists: Playlist[]) =>
ipcRenderer.invoke('DB_MIGRATE_APP_PLAYLISTS', playlists),
dbRecoverLegacyPlaylists: () =>
ipcRenderer.invoke('DB_RECOVER_LEGACY_PLAYLISTS'),
dbUpsertAppPlaylists: (playlists: Playlist[]) =>
ipcRenderer.invoke('DB_UPSERT_APP_PLAYLISTS', playlists),
dbGetAppPlaylists: () => ipcRenderer.invoke('DB_GET_APP_PLAYLISTS'),