1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-07-16 00:14:34 +02:00

Desktop: Fixes #9985: Filter Sync Target Info Logs (#10014)

This commit is contained in:
Sagnik Mandal
2024-03-02 21:27:29 +05:30
committed by GitHub
parent f6c7213f69
commit 9a2a251eec
3 changed files with 105 additions and 3 deletions

View File

@ -240,6 +240,26 @@ export class SyncInfo {
};
}
public filterSyncInfo() {
const filtered = JSON.parse(JSON.stringify(this.toObject()));
// Filter content and checksum properties from master keys
if (filtered.masterKeys) {
filtered.masterKeys = filtered.masterKeys.map((mk: MasterKeyEntity) => {
delete mk.content;
delete mk.checksum;
return mk;
});
}
// Truncate the private key and public key
if (filtered.ppk.value) {
filtered.ppk.value.privateKey.ciphertext = `${filtered.ppk.value.privateKey.ciphertext.substr(0, 20)}...${filtered.ppk.value.privateKey.ciphertext.substr(-20)}`;
filtered.ppk.value.publicKey = `${filtered.ppk.value.publicKey.substr(0, 40)}...`;
}
return filtered;
}
public serialize(): string {
return JSON.stringify(this.toObject(), null, '\t');
}