"this._attachmentIds.get(...) is undefined" in ext-compose.js
Categories
(Thunderbird :: Add-Ons: Extensions API, defect)
Tracking
(thunderbird78 fixed)
Tracking | Status | |
---|---|---|
thunderbird78 | --- | fixed |
People
(Reporter: darktrojan, Assigned: darktrojan)
Details
Attachments
(1 file)
1.02 KB,
patch
|
mkmelin
:
review+
wsmwk
:
approval-comm-beta+
|
Details | Diff | Splinter Review |
If the compose API is used but not for attachments, every time a compose window is closed it tries to forget attachments it wasn't remembering.
Assignee | ||
Comment 1•4 years ago
|
||
This is the easiest thing I've had to fix in a while. :-/
Assignee | ||
Updated•4 years ago
|
Comment 2•4 years ago
|
||
(In reply to Geoff Lankow (:darktrojan) from comment #0)
If the compose API is used but not for attachments, every time a compose window is closed it tries to forget attachments it wasn't remembering.
I don't understand what it's doing then. Seems this is called only once: https://searchfox.org/comm-central/rev/eaa4c5e724230d661b587d05cabfd485ecad84df/mail/components/extensions/parent/ext-compose.js#337
So it's calling the function with some junk? Or why wasn't it remembering them?
Assignee | ||
Comment 3•4 years ago
|
||
They're only in that Map if an extension has done something with attachments. The forgetAttachments call is made whether or not there's attachments in the Map.
Comment 4•4 years ago
|
||
Comment on attachment 9153289 [details] [diff] [review] 1642522-forget-attachment-undefined.diff Review of attachment 9153289 [details] [diff] [review]: ----------------------------------------------------------------- ::: mail/components/extensions/parent/ext-compose.js @@ +322,5 @@ > return this._attachments.has(id); > }, > > forgetAttachment(attachment) { > + let id = this._attachmentIds.get(attachment)?.id; Please add a code comment about it. @@ +327,1 @@ > this._attachmentIds.delete(attachment); Seems this should also be in the if clause. Pointless to try to delete if it wasn't there.
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/eac3756825da
Fix "this._attachmentIds.get(...) is undefined" in ext-compose.js. r=mkmelin
Assignee | ||
Updated•4 years ago
|
Comment 6•4 years ago
|
||
Comment on attachment 9153289 [details] [diff] [review] 1642522-forget-attachment-undefined.diff [Triage Comment] Approved for beta
Comment 7•4 years ago
|
||
bugherder uplift |
Thunderbird 78.0b1:
https://hg.mozilla.org/releases/comm-beta/rev/71067085a232
Updated•4 years ago
|
Description
•