fix(server): allow remote updates with database migrations #5374
Mergedt3dotgg(GitHub profile, opens in a new tab)merged 3 commits into
main fromrefs/pull/5374/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
- @@ -423,3 +560,8 @@423560 reason: string,424561 child?: ManagedChild,425562 ): Promise<void> {563+ if (child !== undefined) {564+ this.#child = null;565+ await terminateChild(child.process);566+ }567+ await restoreDatabaseBackup(this.#baseDir, pending);
- apps/server/src/persistence/Layers/Sqlite.ts line 40Resolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -32,13 +31,10 @@3231 }, Layer.unwrap);333234-const setup = (trial: boolean) =>35- Layer.effectDiscard(36- Effect.gen(function* () {37- const sql = yield* SqlClient.SqlClient;38- yield* sql`PRAGMA foreign_keys = ON;`;39- if (!trial) {40- yield* sql`PRAGMA journal_mode = WAL;`;41- yield* runMigrations();42- }43- }),44- );33+const setup = Layer.effectDiscard(34+ Effect.gen(function* () {35+ const sql = yield* SqlClient.SqlClient;36+ yield* sql`PRAGMA foreign_keys = ON;`;37+ yield* sql`PRAGMA journal_mode = WAL;`;38+ yield* runMigrations();39+ }),40+);
- @@ -110,7 +111,17 @@110111 }111112 }112113114+export class BootServiceUpdatePendingError extends Schema.TaggedErrorClass<BootServiceUpdatePendingError>()(115+ "BootServiceUpdatePendingError",116+ {},117+) {118+ override get message(): string {119+ return "A remote server update is still pending. Wait for it to finish, then retry.";120+ }121+}122+113123 export type BootServiceError =114124 | BootServiceUnsupportedError115125 | BootServiceCommandError116- | BootServiceInstallError;126+ | BootServiceInstallError127+ | BootServiceUpdatePendingError;
t3dotgg(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.


Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID:
72f6d094-55e7-4370-9f30-73c151986d93You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share