gmail.js
gmail.js copied to clipboard
[BUG] `is_deleted` has false positives in `api.get.email_data()`
So this is a part extension of #39, where 'folded' emails don't contain the email's meta data when running api.get.email_data()
. The check for detecting deleted emails in #41 is checking the existence of the meta data. This intersection returns false positives.
Possible solution:
Sift through api.tracker.email_data
after calling api.get.email_data()
and detect what elements are present/not present in a deleted message vs undeleted message. Instead of doing the x[13] == undefined
check
Hi,
I found something hopefully not subject to change (but well, that's what Gmail interface is about).
In the api.tracker.email_data
, in every Array[48] containing a specific email data, index 3
property has an integer value that can correspond to different status:
-
1
: deleted ; -
2
: hidden, folded (i.e. in the "older messages") ; -
3
: visible, folded (i.e. we can read its header but not the whole content) ; -
4
: visible.
Note that for that property, deletion status takes precedence over visibility status. For example from the trash, all emails have a 1
(deleted) status.
Hope that helps.
Hey @g8g3 thanks for looking into this. This is very useful! I'll look into patching this issue tomorrow and see if we can solve the other one as well.
Isn't the status
thing OK to be merged on its own?
I pushed it on thread-observer
, but it can actually be useful right away (some problems occur due to the is_deleted
property).
Old issue is old. Closing.