Refactor startup lifecycle into service features

This commit is contained in:
vorotamoroz
2026-09-03 12:20:05 +00:00
parent 3b2d5aa5af
commit 338aecd888
30 changed files with 2184 additions and 963 deletions
@@ -0,0 +1,23 @@
import { LOG_LEVEL_NOTICE } from "@vrtmrz/livesync-commonlib/compat/common/logger";
import type { LogFunction } from "@vrtmrz/livesync-commonlib/compat/services/lib/logUtils";
import { $msg } from "@/common/translation";
import { disableLegacyBulkChunkPreSend } from "@/common/compatibilitySettings";
import type { LegacyBulkSendSettings } from "./types";
/** Collaborators required to persist the obsolete bulk-send setting migration. */
export interface BulkSettingMigrationDependencies {
readonly settings: LegacyBulkSendSettings;
readonly log: LogFunction;
readonly saveSettings: () => Promise<void>;
}
/**
* Disable the removed automatic bulk chunk pre-send setting, retaining the
* former notice text and persistence boundary.
*/
export async function migrateBulkSendSetting(dependencies: BulkSettingMigrationDependencies): Promise<void> {
if (disableLegacyBulkChunkPreSend(dependencies.settings)) {
dependencies.log($msg("moduleMigration.logBulkSendCorrupted"), LOG_LEVEL_NOTICE);
await dependencies.saveSettings();
}
}