@@ -11,12 +11,11 @@ import {
1111} from "./named-backup-export.js" ;
1212import { MODEL_FAMILIES , type ModelFamily } from "./prompts/codex.js" ;
1313import { clearAccountStorageArtifacts } from "./storage/account-clear.js" ;
14+ import { clearAccountsEntry } from "./storage/account-clear-entry.js" ;
1415import { cloneAccountStorageForPersistence } from "./storage/account-persistence.js" ;
1516import {
16- clearFlaggedAccountsEntry ,
1717 exportAccountsSnapshot ,
1818 importAccountsSnapshot ,
19- saveFlaggedAccountsEntry ,
2019} from "./storage/account-port.js" ;
2120import { saveAccountsToDisk } from "./storage/account-save.js" ;
2221import { buildBackupMetadata } from "./storage/backup-metadata-builder.js" ;
@@ -1847,17 +1846,18 @@ export async function saveAccounts(storage: AccountStorageV3): Promise<void> {
18471846 * Silently ignores if file doesn't exist.
18481847 */
18491848export async function clearAccounts ( ) : Promise < void > {
1850- return withStorageLock ( async ( ) => {
1851- const path = getStoragePath ( ) ;
1852- await clearAccountStorageArtifacts ( {
1853- path,
1854- resetMarkerPath : getIntentionalResetMarkerPath ( path ) ,
1855- walPath : getAccountsWalPath ( path ) ,
1856- backupPaths : await getAccountsBackupRecoveryCandidatesWithDiscovery ( path ) ,
1857- logError : ( message , details ) => {
1858- log . error ( message , details ) ;
1859- } ,
1860- } ) ;
1849+ const path = getStoragePath ( ) ;
1850+ return clearAccountsEntry ( {
1851+ path,
1852+ withStorageLock,
1853+ resetMarkerPath : getIntentionalResetMarkerPath ( path ) ,
1854+ walPath : getAccountsWalPath ( path ) ,
1855+ getBackupPaths : ( ) =>
1856+ getAccountsBackupRecoveryCandidatesWithDiscovery ( path ) ,
1857+ clearAccountStorageArtifacts,
1858+ logError : ( message , details ) => {
1859+ log . error ( message , details ) ;
1860+ } ,
18611861 } ) ;
18621862}
18631863
0 commit comments