esi / esi-issues

Issue tracking and feature requests for ESI
https://esi.evetech.net/
208 stars 23 forks source link

Bug: Mail endpoints returning deleted mails. #859

Open antihax opened 6 years ago

antihax commented 6 years ago

Bug

ESI is returning all deleted mails when requesting labels.

Request

        mails, _, err := mbox.user.backend.esi.ESI.MailApi.GetCharactersCharacterIdMail(
            auth,
            mbox.user.characterID,
            &esi.GetCharactersCharacterIdMailOpts{
                Labels:     optional.NewInterface([]int32{mbox.id}),
                LastMailId: optional.NewInt64(lastMailID),
            },
        )

Response

All mails from the character including deleted.

Expected

Just current mails from the character.

ghost commented 6 years ago

Does this only happen when using the optional labels attribute, or also when pulling all mail headers indiscriminately?

It sounds like this is from the /characters/{character_id}/mail/ headers endpoint. Can you pull the body of a deleted mail from /characters/{character_id}/mail/{mail_id}/ ?

ghost commented 6 years ago

Hrm, so looking into this closer, it looks like ESI does not return deleted mails, but it does return mails in the trash. This is not quite the same thing.

Does that match with your observations? If yes, the next question is, does deleting a mail via ESI endpoint fully delete it or merely move it to the trash?

SpeedProg commented 6 years ago

It does return mails from mailinglists you are not part of anymore too actually nvm >.< I forgot the thing has pagination ingame >.< so now I need to empty my trash and try again after api cache expires >.<

ghost commented 6 years ago

Hrm, at this point I probably need to start looking at live examples.

If people are willing, could they please PM me mailID/characterID pairs on slack so I can go look them up in the eve DB. Please only IDs for mails you have the right to authorize me to read.

SpeedProg commented 6 years ago

So for what is happening to me I actually found out what is going on (and I can actually see the mails ingame, not sure if that should happen through).

So if I was part of a mailing list and left the mailing list. I can still see mails from that mailing list (that where send while I was on it) in "All Mails" (but no where else because I am not port of the ML anymore).

Also for trash mails, how do we even know a mail is in the trash, that doesn't seem to be a label? 🗡

ghost commented 6 years ago

image

It's a category on the sidebar, or do you mean how would you tell though the API?

Being able to see mails that were sent to a mailing list you were on at the time they were sent even though you've left sounds like it's working as intended to me. You received the mail, why would it vanish from your inbox just because you left the mailing list? That's not how normal email or physical mail works.

SpeedProg commented 6 years ago

Yeah no I meant on API :D

But yeah, my stuff was my own failure to not know that the ML mails persist under All Mails >.<

cvweiss commented 6 years ago

I believe the issue here is that mails that were deleted and then purged (trash emptied) were still showing up via API.

ddavaham commented 6 years ago

So I can confirm that trashed mails are still showing up on the API;

https://i.imgur.com/BjVqjSs.png

https://i.imgur.com/ABSUB6N.png

CharId/MailId: 96154467 / 360319563

However, I can also confirm that when using a label, no completely deleted mails are showing up on the API (i.e. Mail that I have deleted in game.)

ghost commented 6 years ago

@cvweiss I'm looking for characterID/mailID pairs of that exact case, because I can't find evidence that it exists. If you've got some, PM them to me on slack?

@SpeedProg I can't see any way for you to tell that a mail is trashed via the API. I think that's where most of the confusion is coming from.

ghost commented 6 years ago

It looks like there are also cases where mails are not showing up in the client that are still in the DB as neither trashed nor deleted. I'm speculating there's some kind of max age/max size limit on showing mails in the client that we're bypassing on the API.

ghost commented 6 years ago

Yup, the client retrieves a maximum of 1500 mails, including the contents of your trash bin. So if you've got a very full inbox and you start deleting mails you'll probably see old mails coming back.

ghost commented 5 years ago

Ok, so quick rally on this ticket because I think it can be closed but not totally sure. My understanding of this situation:

  1. Trashed mails are not the same as deleted mails, one must empty ones trashbin to delete a mail.
  2. Trashed mails show in the API, as intended
  3. Deleted mails do not show in the API, as intended
  4. The API will show more mails than the client, which can cause confusion but is not a bug.

On that basis I think there's no work to be done here, have I forgotten anything?

ddavaham commented 5 years ago

So what about being able to tell a mail has been trashed (not deleted) via the API? You mentioned this earlier and a fix still has not been determined.

ghost commented 5 years ago

Ok, so 2 is false, trashed mails do not show in the API, or at least they don't show as trashed?

cvweiss commented 5 years ago

In game mails are trashed to a "trash can" API doesn't indicate this in any way, nor can we move mails to/from "trash can" via api

ddavaham commented 5 years ago

They show, but without any indication that they have been trashed. There is no trashed label or flag on the header telling us it's been trashed.

ErikKalkoken commented 3 years ago

I just stumbled over this issue. It is still not possible to detect via API that a mail has been trashed.

It would be awesome if some kind of flag could be added (or a special label) to mails to make it possible to detect trashed mails via API.