Conversation
|
wip: adding a test |
…oper-backup-detection
|
Hi @sosnovsky - This one is ready for a review. Thank you! |
| if (notUserOwnedPrvKey) { | ||
| $('.backup_message_text').text( | ||
| 'This message contains a private key received from ' + | ||
| this.fromEmail + | ||
| '. Import only if you intentionally sent this to yourself or received it from your administrator.' | ||
| ); | ||
| if (notUserOwnedPrvKey) { |
There was a problem hiding this comment.
duplicated if (notUserOwnedPrvKey) { :)
| `This private key with fingerprint <span class="green">${Xss.escape(Str.spaced(fingerprint))}</span> has already been imported.` | ||
| ); | ||
| } else { | ||
| const notUserOwnedPrvKey = this.fromEmail !== this.acctEmail; |
There was a problem hiding this comment.
what about user email aliases? here we check only main user email, but email aliases will probably show warning message. in MessageRenderer we have isOutgoing method which checks array of sendAs aliases, I think we should use similar check here too:
| public srcBackupIframe = (armoredPrvBackup: string) => { | ||
| return this.frameSrc(this.extUrl('chrome/elements/backup.htm'), { frameId: this.newId(), armoredPrvBackup }); | ||
| public srcBackupIframe = (armoredPrvBackup: string, fromEmail?: string) => { | ||
| return this.frameSrc(this.extUrl('chrome/elements/backup.htm'), { frameId: this.newId(), armoredPrvBackup, fromEmail }); |
There was a problem hiding this comment.
fromEmail is required property in backup.ts (https://github.com/FlowCrypt/flowcrypt-browser/blob/issue-6199-fix-improper-backup-detection/extension/chrome/elements/backup.ts#L22), but here optional value fromEmail?: string is passed.
what happens if undefined value is passed? backup.htm will probably fail to render, could you please check?
This PR improves user's backup detection rendered in Gmail.
Closes #6199
Tests (delete all except exactly one):
To be filled by reviewers
I have reviewed that this PR... (tick whichever items you personally focused on during this review):