Comments (8)
That warning is thrown from (tryReadBody
) the function above the one you highlited. (On my mobile) unless I missed something that function does not call pathForBodyFile
.
Edit: Nice ninja edit 👍
from nylas-mail.
Is this issue occuring in our fork only?
Note: this works fine for me in Nylas stable.
from nylas-mail.
The log references this piece of code:
if (remainingId) {
while (pathGroups.length < MAX_PATH_DIRS) {
pathGroups.push(remainingId.substring(0, 2));
remainingId = remainingId.substring(2);
}
}
I think this error could be solved checking if remainingId
is not undefined
in the while
condition. If it's checked outside, remainingId
will eventually become undefined
and the line pathGroups.push(remainingId.substring(0, 2));
will throw an exception.
EDIT: Debugging I realized that the error is being thrown here:
from nylas-mail.
You're right, the problem is in tryReadBody
. As far as I could see it's happening with emails sent from the client-app. If I send an email from outside (let's say gmail, for example) the email is received and the body is parsed ok. I'm still debugging, let you know if I find something
from nylas-mail.
The error seems to be the client-app creating the file to save the email body when we create a new message, but not updating it at all. The file doesn't get updated because the writeBody
function is called with forceWrite = false
every time. I think we can change it to set forceWrite = true
whenever the message is a draft. In one picture, what I propose is this change:
As far as I tested it solves the problem and doesn't have a negative impact on performance because the file is written just 2 times (vs 1 before the change): one when we click on 'New message' and the other when we send it.
@dweremeichik if it's ok for you I can make a PR
from nylas-mail.
@agurz PRs are absolutely welcome! Once you submit one, we will likely get more eyes on it.
from nylas-mail.
So I see why it is not updating, like you stated. I suppose I would need to debug it myself to understand exactly why that function was designed that way, they have comments saying that it is slow to write to the file system, and if they can't write to the file system, they fall back to the DB. What bugs me is they aren't diffing the files at all, it's simply a test of whether the file exists or not. Perhaps their intent is to save interaction with the filesystem. Which means that they would always need to know before hand when they needed to update the file, hence the force write as you suggested. Sorry for the rant, verbalizing my thoughts... Based on what I see, you are doing the right thing @agurz.
from nylas-mail.
putting this here for future reference. in the new code drop from nylas, nylas/nylas-mail@af3de33 removes forceWrite altogether. i'm keeping nylas' change (removing it) instead of our change (changing it) for the code dump merge. if this isn't right, we'll need to open another issue
from nylas-mail.
Related Issues (20)
- Delete / remove individual messages in a conversation HOT 5
- loss of internet connection by opening Nylas Mail HOT 26
- Feedback: After adding an account you are returned to the main inbox instead of the settings page. HOT 3
- [Feature request] - Autocrypt support
- Issue in FileDownloadStore that forces re-download of files HOT 2
- Reference header including *.nylas.com HOT 2
- Does open tracking stopped ? HOT 4
- Nylas mail not showing pdf attachments HOT 3
- Update Electron to 1.7.11 HOT 3
- Nylas Isn't Downloading/Syncing Attachments Properly
- The Top Menu "File" shows options for "edit" & edit is gone HOT 2
- What can I do to help? HOT 4
- Failed at the @paulcbetts/[email protected] install script 'node-gyp rebuild' HOT 2
- Compatibility Issues with v2.2.3 Dependencies HOT 6
- Nylas Mail "messages in a thread require an IMAP uid to perform an action" with gmail HOT 7
- Adding default signature even after all signatures have been deleted HOT 1
- No windows binary is latest release HOT 3
- Failing install 2.2.3 NylasMail.dmg: A javascript error occurred in the main process HOT 1
- ccccccicevufgrhcbfgcrggvfhctknbhiuhcjnhuhvbb HOT 4
- A JavaScript error occurred in the main process HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nylas-mail.