Commit 0dd6e9a
committed
fix(decrypt): await postal-mime import in parseMail to avoid race
The previous fire-and-forget dynamic import left `PostalMime` undefined
until the network round-trip resolved. Callers that hit parseMail before
that (e.g. a hard-reload onto `/decrypt#<envelope>` on a slow connection)
threw `Cannot read properties of undefined (reading 'default')`, which
the surrounding catch swallowed into a generic "decryption failed" — even
though decryption itself had succeeded.
Replace with a memoized import promise that parseMail awaits at every
call. All call sites already used await/.then so this is a no-op for them.
Closes #2531 parent 277712b commit 0dd6e9a
1 file changed
Lines changed: 11 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
13 | | - | |
14 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
15 | 18 | | |
16 | 19 | | |
17 | 20 | | |
| |||
0 commit comments