From 2af895477f512e76da0d1c2291b8e1a875690c1d Mon Sep 17 00:00:00 2001 From: Henry Heino <46334387+personalizedrefrigerator@users.noreply.github.com> Date: Fri, 4 Jul 2025 10:52:54 -0700 Subject: [PATCH] Cli: Refresh shares when running the sync command (#12667) --- packages/app-cli/app/command-sync.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/app-cli/app/command-sync.ts b/packages/app-cli/app/command-sync.ts index 65136b2842..4fae7570eb 100644 --- a/packages/app-cli/app/command-sync.ts +++ b/packages/app-cli/app/command-sync.ts @@ -17,6 +17,7 @@ import { pathExists, writeFile } from 'fs-extra'; import { checkIfLoginWasSuccessful, generateApplicationConfirmUrl } from '@joplin/lib/services/joplinCloudUtils'; import Logger from '@joplin/utils/Logger'; import { uuidgen } from '@joplin/lib/uuid'; +import ShareService from '@joplin/lib/services/share/ShareService'; const logger = Logger.create('command-sync'); @@ -230,6 +231,10 @@ class Command extends BaseCommand { return cleanUp(); } + // Refresh share invitations -- if running without a GUI, some of the + // maintenance tasks may otherwise be skipped. + await ShareService.instance().maintenance(); + this.stdout(_('Starting synchronisation...')); const contextKey = `sync.${this.syncTargetId_}.context`;