[PR #6346] [MERGED] Fix sync server migrations #32380

Closed
opened 2026-04-18 08:25:57 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/6346
Author: @jgranick
Created: 12/9/2025
Status: Merged
Merged: 2/4/2026
Merged by: @matt-fidd

Base: masterHead: fix-sync-server-migrations


📝 Commits (10+)

  • cf86fdc Fix sync-server migrations to use ESM loader
  • 5fbe29f Add release notes
  • df52ad3 Merge branch 'master' into fix-sync-server-migrations
  • 9630fc0 Apply CodeRabbit suggestions
  • d648b60 [autofix.ci] apply automated fixes
  • c65dd07 Merge branch 'master' into fix-sync-server-migrations
  • 84986cb Add file extension filter to sync-server migrations import
  • 9e3b2a8 [autofix.ci] apply automated fixes
  • 25b92d4 Merge branch 'master' into fix-sync-server-migrations
  • 19f9784 Ensure migrations occur synchronously

📊 Changes

3 files changed (+64 additions, -39 deletions)

View changed files

packages/sync-server/src/migrations.js (+0 -39)
packages/sync-server/src/migrations.ts (+58 -0)
upcoming-release-notes/6346.md (+6 -0)

📄 Description

This fixes npx vitest run following the recent ESM loader changes in the sync-server module.

  • Rename migrations.js to migrations.ts
  • Adds some types
  • Uses migrations instead of migrationsDirectory

Note

Rewrites the sync-server migrations runner to TypeScript using ESM and dynamic imports, switching to migrate.load with a migrations map and adding release notes.

  • Sync Server:
    • Migrations runner: Rewritten in packages/sync-server/src/migrations.ts to TypeScript and ESM.
      • Dynamically imports migration files from ../migrations (.js/.ts), sorted.
      • Uses load({ stateStore, migrations }) instead of migrationsDirectory.
      • Supports run(direction: 'up' | 'down') with improved error handling and logging.
  • Release Notes:
    • Adds upcoming-release-notes/6346.md (Bugfix) noting ESM loader change for migrations.

Written by Cursor Bugbot for commit 25b92d407f. This will update automatically on new commits. Configure here.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/actualbudget/actual/pull/6346 **Author:** [@jgranick](https://github.com/jgranick) **Created:** 12/9/2025 **Status:** ✅ Merged **Merged:** 2/4/2026 **Merged by:** [@matt-fidd](https://github.com/matt-fidd) **Base:** `master` ← **Head:** `fix-sync-server-migrations` --- ### 📝 Commits (10+) - [`cf86fdc`](https://github.com/actualbudget/actual/commit/cf86fdcc85d0dd9e5a5a49b8835d667969f5be83) Fix sync-server migrations to use ESM loader - [`5fbe29f`](https://github.com/actualbudget/actual/commit/5fbe29fbf40803efd6ba1f3b4878a24d3c4d2a36) Add release notes - [`df52ad3`](https://github.com/actualbudget/actual/commit/df52ad3133bb3b027baadb7d5df6577aafa4d486) Merge branch 'master' into fix-sync-server-migrations - [`9630fc0`](https://github.com/actualbudget/actual/commit/9630fc08785aa7be10c1b963845df5557b774d72) Apply CodeRabbit suggestions - [`d648b60`](https://github.com/actualbudget/actual/commit/d648b6069f3e1e6462e9d8ecb9d81822015ea222) [autofix.ci] apply automated fixes - [`c65dd07`](https://github.com/actualbudget/actual/commit/c65dd07bbb53cd881cb3fb49b69defa686925a1a) Merge branch 'master' into fix-sync-server-migrations - [`84986cb`](https://github.com/actualbudget/actual/commit/84986cb8ee356df7696e631fc91078ee06abcd29) Add file extension filter to sync-server migrations import - [`9e3b2a8`](https://github.com/actualbudget/actual/commit/9e3b2a889a0113f3b646c116378cfaf19acc5b9f) [autofix.ci] apply automated fixes - [`25b92d4`](https://github.com/actualbudget/actual/commit/25b92d407f632c024fb26196dd0deb897a4f1386) Merge branch 'master' into fix-sync-server-migrations - [`19f9784`](https://github.com/actualbudget/actual/commit/19f9784bdaa8b03b7547b51f62e1dcb467faa2e3) Ensure migrations occur synchronously ### 📊 Changes **3 files changed** (+64 additions, -39 deletions) <details> <summary>View changed files</summary> ➖ `packages/sync-server/src/migrations.js` (+0 -39) ➕ `packages/sync-server/src/migrations.ts` (+58 -0) ➕ `upcoming-release-notes/6346.md` (+6 -0) </details> ### 📄 Description This fixes `npx vitest run` following the recent ESM loader changes in the sync-server module. * Rename migrations.js to migrations.ts * Adds some types * Uses `migrations` instead of `migrationsDirectory` <!-- Thank you for submitting a pull request! Make sure to follow the instructions to write release notes for your PR — it should only take a minute or two: https://github.com/actualbudget/docs#writing-good-release-notes. Try running yarn generate:release-notes *before* pushing your PR for an interactive experience. --> <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Rewrites the sync-server migrations runner to TypeScript using ESM and dynamic imports, switching to migrate.load with a migrations map and adding release notes. > > - **Sync Server**: > - **Migrations runner**: Rewritten in `packages/sync-server/src/migrations.ts` to TypeScript and ESM. > - Dynamically imports migration files from `../migrations` (`.js`/`.ts`), sorted. > - Uses `load({ stateStore, migrations })` instead of `migrationsDirectory`. > - Supports `run(direction: 'up' | 'down')` with improved error handling and logging. > - **Release Notes**: > - Adds `upcoming-release-notes/6346.md` (Bugfix) noting ESM loader change for migrations. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 25b92d407f632c024fb26196dd0deb897a4f1386. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-18 08:25:57 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#32380