gmail.js icon indicating copy to clipboard operation
gmail.js copied to clipboard

[BUG] `is_deleted` has false positives in `api.get.email_data()`

Open KartikTalwar opened this issue 10 years ago • 3 comments

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

KartikTalwar avatar Mar 08 '14 04:03 KartikTalwar

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.

ghost avatar Mar 10 '14 10:03 ghost

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.

KartikTalwar avatar Mar 11 '14 19:03 KartikTalwar

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).

ghost avatar Apr 23 '14 09:04 ghost

Old issue is old. Closing.

josteink avatar Oct 11 '23 08:10 josteink