19
votes

When sending drafts via the Gmail REST API, the message in the "Sent Mail" folder can't be opened by the sender in the new Gmail UI. You get the error message "The conversation that you requested could not be loaded.".

The message on the recipient side can be opened without problem though, new UI or not.

Reverting to the old/classic Gmail UI allows the sender to open the sent message.

Steps to reproduce:

  1. Compose a draft in Gmail (new or old UI doesn't matter)
  2. Find the draft ID via GET https://www.googleapis.com/gmail/v1/users/me/drafts
  3. Send the draft via POST https://www.googleapis.com/gmail/v1/users/me/drafts/send with body {"id": "<draftId>"}
  4. Go back to Gmail and switch to the new Gmail UI, then attempt to open the recently sent draft in the Sent folder. Attempting to open the message will fail.
  5. Revert to the old/classic Gmail UI and open the recently sent draft in the Sent folder. You will be able to open the message without issues.
  6. The recipient will be able to open the message without issues, using either the new or old UI.

UPDATE

When the broken sent email receives a reply, it seems to get 'fixed' and the sender can now open the sent email from the new Gmail UI. This seems to suggest that the REST API is missing something that gets fixed once the thread is updated by other means?

The error message in the browser console when attempting to open the broken sent message:

Error: Ppa No message loaded when we received the DETAILED_CONVERSATION_MESSAGES_LOADED event.

1
I have the same problem - and I'm unable to find any workaround. Seems like a bug in new Gmail UI. The message are 100% valid and I can see them using IMAP client or old Gmail UI.Robert Grezan
I think there is "state skew" between the new Gmail UI, the old UI, and the Rest API. A related issue, where "unread" in the new Gmail UI is not the same as "unread" in the old UI: stackoverflow.com/questions/51858633/…payne

1 Answers

0
votes

I can't reproduce this. Note that in the reproduction steps #2 is unnecessary. Instead, the result of drafts.create() in #1 should be analyzed, the id of the new draft message is present there.

Also worth noting, Draft IDs are not the same as Message IDs. The response of drafts.create() and drafts.update() will be a Draft ID while the result of drafts.send() will be the message ID. When viewing the sent message in Gmail UI make sure you are using the message ID.