TypeError in Preview Pane after clicking 'Mark As Read'
Ran across an issue that potentially could be related to my email account. Previously for this email I use from Posteo.de (IMAP), which has a different domain (.net instead of .de), there was an issue with new mail only being synced on startup for some reason, but was resolved a few versions ago. However this morning I tried to mark an email as read via the right-click context menu, and the preview pane began displaying a read box of error message info:
TypeError: Failed to execute 'evaluate' on 'Document': parameter 2 is not of type 'Node'. at QuotedHTMLTransformer._removeImagesStrippedByAnotherClient (/src\services\quoted-html-transformer.es6:62:24) at QuotedHTMLTransformer.removeQuotedHTML (/src\services\quoted-html-transformer.es6:55:10) at EmailFrame._emailContent (/internal_packages\message-list\lib\email-frame.jsx:59:34) at EmailFrame._writeContent (/internal_packages\message-list\lib\email-frame.jsx:83:72) at EmailFrame.componentDidMount (/internal_packages\message-list\lib\email-frame.jsx:27:10)
Are there any related issues?
None that I could find
What operating system are you using?
Windows 7
What version of Mailspring are you using?
1.1.2-8ae17eae
--
Bug?
Do you have any third-party plugins installed? If so, which ones?
Default Plugins if any
Is the issue related to a specific email provider (Gmail, Exchange, etc.)?
Possibly, previously had issues with this provider (IMAP, Posteo.de)
Is the issue reproducible with a particular attachment, message, signature, etc?

--
Feature Request?
Does this feature exist in another mail client or tool you use?
No
As follow up, this apparently was not a one-off issue, the message pane in general was stuck on this error for all accounts, and changing my theme or my Pane layout 3 to 2 did not fix the issue.
~~I was able to resolve it by then switching back to my original 3 Pane layout, and now all accounts are showing the reading pane. The reading pane now has a bar for "Show Images | Always Show Images from ..." , which had not been showing previously. Perhaps there was an incomplete refresh of the Reading Pane code after an update?~~
Redoing "Mark As Read" via right-click with the original email caused this issue to re-occur.
Refreshing email cache worked temporarily, but the original email still creates this crash:
- Original email is a 19 email Zendesk email chain. Other mitigation techniques work well for other emails, but redoing this step causes this error on this mail chain.
Hey! Thanks for reporting this – we've run into a few of these issues because the most recent version of the client uses React 16, which handles some types of errors more aggressively. I think this should be fixed by 24746823c8dd809d280e1883f62e65148dc7724c, but I'm going to leave it open for a bit to double check. (This /should/ do it, but it'd be difficult to verify without the exact email.) Thanks!
Hey folks—version 1.1.3 shipped a few days ago and included the fix for this issue. You should have received the update automatically, but if not you can download it directly from getmailspring.com/download. Enjoy! Gonna go ahead and close this.
Still experiencing this issue on 1.1.3 on Debian Stretch x64, it appears that _removeImagesStrippedByAnotherClient is getting called with a document with a missing body: property.
The cause appears to be that removeQuotedHTML is inadvertently deleting the html element at line 50, see screenshot below.
If the code at lines 49-53 is changed to the following it should prevent the html node & descendants from being deleted:
for (const el of quoteStringDetector(doc)) {
if (el && el !== doc.body && el !== doc.firstChild) {
el.remove();
}
}
TypeError: Failed to execute 'evaluate' on 'Document': parameter 2 is not of type 'Node'.
at QuotedHTMLTransformer._removeImagesStrippedByAnotherClient (/src/services/quoted-html-transformer.es6:62:24)
at QuotedHTMLTransformer.removeQuotedHTML (/src/services/quoted-html-transformer.es6:55:10)
at EmailFrame._emailContent (/internal_packages/message-list/lib/email-frame.jsx:59:34)
at EmailFrame._writeContent (/internal_packages/message-list/lib/email-frame.jsx:83:72)
at EmailFrame.componentDidMount (/internal_packages/message-list/lib/email-frame.jsx:27:10)
at commitLifeCycles (/usr/share/mailspring/resources/app.asar/node_modules/react-dom/cjs/react-dom.production.min.js:149:193)
at b (/usr/share/mailspring/resources/app.asar/node_modules/react-dom/cjs/react-dom.production.min.js:158:229)
at m (/usr/share/mailspring/resources/app.asar/node_modules/react-dom/cjs/react-dom.production.min.js:169:217)
at w (/usr/share/mailspring/resources/app.asar/node_modules/react-dom/cjs/react-dom.production.min.js:168:413)
at z (/usr/share/mailspring/resources/app.asar/node_modules/react-dom/cjs/react-dom.production.min.js:167:32)
at u (/usr/share/mailspring/resources/app.asar/node_modules/react-dom/cjs/react-dom.production.min.js:165:441)
at Object.enqueueSetState (/usr/share/mailspring/resources/app.asar/node_modules/react-dom/cjs/react-dom.production.min.js:108:299)
at MessageItemBody.A.setState (/usr/share/mailspring/resources/app.asar/node_modules/react/cjs/react.production.min.js:12:357)
at _unsub._mailspringExports.MessageBodyProcessor.subscribe.processedBody (/internal_packages/message-list/lib/message-item-body.jsx:63:29)
at retrieve.then.output (/src/flux/stores/message-body-processor.es6:97:13)
I have this now as well. I use linux mint 18 and mailspring 1.1.4
TypeError: Failed to execute 'evaluate' on 'Document': parameter 2 is not of type 'Node'. at QuotedHTMLTransformer._removeImagesStrippedByAnotherClient (/src/services/quoted-html-transformer.es6:62:24) at QuotedHTMLTransformer.removeQuotedHTML (/src/services/quoted-html-transformer.es6:55:10) at EmailFrame._emailContent (/internal_packages/message-list/lib/email-frame.jsx:59:34) at EmailFrame._writeContent (/internal_packages/message-list/lib/email-frame.jsx:83:72) at EmailFrame.componentDidMount (/internal_packages/message-list/lib/email-frame.jsx:27:10) at commitLifeCycles (/usr/share/mailspring/resources/app.asar/node_modules/react-dom/cjs/react-dom.production.min.js:149:193) at b (/usr/share/mailspring/resources/app.asar/node_modules/react-dom/cjs/react-dom.production.min.js:158:229) at m (/usr/share/mailspring/resources/app.asar/node_modules/react-dom/cjs/react-dom.production.min.js:169:217) at w (/usr/share/mailspring/resources/app.asar/node_modules/react-dom/cjs/react-dom.production.min.js:168:413) at z (/usr/share/mailspring/resources/app.asar/node_modules/react-dom/cjs/react-dom.production.min.js:167:32) at u (/usr/share/mailspring/resources/app.asar/nod
@bengotow can you fix this?
I can also confirm this. A temporary walkaround is disabling reading pane.
I also have this issue, Ubuntu 16.04.2 LTS, Mailspring 1.1.15