Closed Bug 1765974 Opened 2 years ago Closed 2 years ago

In TB composer, refresh recipient encryption status and key assistant on external OpenPGP key changes

Categories

(MailNews Core :: Security: OpenPGP, defect, P1)

Tracking

(thunderbird_esr91 unaffected)

RESOLVED FIXED
101 Branch
Tracking Status
thunderbird_esr91 --- unaffected

People

(Reporter: KaiE, Assigned: KaiE)

References

(Blocks 2 open bugs)

Details

Attachments

(2 files)

The initial work for bug 1627956 (landed in bug 1764324),
added notification elements to the composer window.

If encryption is enabled, but encryption is impossible because of missing keys/certificates, we highlight the problematic recipients in yellow color, and we show a notification bar that mentions that encryption isn't possible.

The problem is:
If changes to keys/certificates keys are made in another window, the status isn't updated.

For example, if composer complains about a recipient, and the user opens the OpenPGP key manager and fixes the issue, and the user then returns to the composer window, we still complain that sending isn't possible.

The reverse scenario is also true: If composer thinks that everything is fine, but the user disables a key in OpenPGP key manager (or refreshes they key, resulting in a key now being revoked), and then the user returns to the composer window, then composer will not report the inability to send.

To fix this issue, we should refresh the key status each time focus moves back to the composer window, and update the status shown accordingly.

Severity: -- → S2
Priority: -- → P1

Fixing this isn't as easy as I had hoped.
I experimented with the "focus" and "focusout" events.

If the focus is on the composer's message editor, and I switch between the composer window and other windows, then I don't see any focus events triggered!

Does that mean we need to watch for focus events on the editor sub-element, too?
Are there other elements that we would have to watch, to ensure we catch the window focus event, regardless of which element in the window has focus?

See Also: → 1765977

I have the impression the "focus" approach is too difficult/involved.

It might be better to use a broadcast/observing approach, that is triggered whenever any pgp key changes, gets added, gets deleted, or if any acceptance changes.

I have a fix that uses the broadcast/observer approach, which fixes the scenarios of this bug, and also of bug 1765977, so let's merge the bugs.

Summary: In TB composer, when switching back from another window, refresh encryption status → In TB composer, refresh recipient encryption status and key assistant on external OpenPGP key changes
Assignee: nobody → kaie
Status: NEW → ASSIGNED
Target Milestone: --- → 101 Branch

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/bffeb4e58a94
Refresh key assistant views after viewing key details. r=mkmelin
https://hg.mozilla.org/comm-central/rev/d671d57c328d
Automatic refresh of encryption status in composer after OpenPGP key change events. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
See Also: → 1621796
Blocks: 1768866
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: