mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-07-20 01:46:19 +00:00
debug: add verbose logging to deleteAllData and uploadSnapshot
Track API calls during encryption disable: - Log when DELETE /api/sync/data starts and completes - Log when snapshot upload starts and response received - Show server responses to diagnose silent failures This will help identify why encryption disable completes without visible network activity.
This commit is contained in:
parent
b10b2e499b
commit
1ba4c0ca7f
1 changed files with 12 additions and 2 deletions
|
|
@ -216,7 +216,7 @@ export class SuperSyncProvider
|
|||
isPayloadEncrypted: boolean | undefined,
|
||||
opId: string,
|
||||
): Promise<SnapshotUploadResponse> {
|
||||
SyncLog.debug(this.logLabel, 'uploadSnapshot', {
|
||||
SyncLog.normal(this.logLabel, 'uploadSnapshot: Starting...', {
|
||||
clientId,
|
||||
reason,
|
||||
schemaVersion,
|
||||
|
|
@ -276,6 +276,12 @@ export class SuperSyncProvider
|
|||
compressedPayload,
|
||||
);
|
||||
|
||||
SyncLog.normal(this.logLabel, 'uploadSnapshot: Complete', {
|
||||
accepted: response.accepted,
|
||||
serverSeq: response.serverSeq,
|
||||
error: response.error,
|
||||
});
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
|
|
@ -310,16 +316,20 @@ export class SuperSyncProvider
|
|||
// === Data Management ===
|
||||
|
||||
async deleteAllData(): Promise<{ success: boolean }> {
|
||||
SyncLog.debug(this.logLabel, 'deleteAllData');
|
||||
SyncLog.normal(this.logLabel, 'deleteAllData: Starting DELETE request...');
|
||||
const cfg = await this._cfgOrError();
|
||||
|
||||
SyncLog.normal(this.logLabel, 'deleteAllData: Calling DELETE /api/sync/data');
|
||||
const response = await this._fetchApi<{ success: boolean }>(cfg, '/api/sync/data', {
|
||||
method: 'DELETE',
|
||||
});
|
||||
|
||||
SyncLog.normal(this.logLabel, 'deleteAllData: Server response:', response);
|
||||
|
||||
// Reset local lastServerSeq since all server data is deleted
|
||||
const key = await this._getServerSeqKey();
|
||||
localStorage.removeItem(key);
|
||||
SyncLog.normal(this.logLabel, 'deleteAllData: Cleared local lastServerSeq');
|
||||
|
||||
return response;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue