通过Gmail REST API发送的电子邮件/草稿无法在新的Gmail UI中打开

问题描述:

通过Gmail REST API发送草稿时,发件人无法在新的Gmail UI中打开已发送邮件"文件夹中的消息.您收到错误消息"The conversation that you requested could not be loaded.".

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

可以打开收件人侧的消息,无论是否使用新的UI,都可以.

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

返回到旧的/经典的Gmail UI,发件人可以打开已发送的邮件.

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

复制步骤:

  1. 在Gmail中撰写草稿(新旧UI无关紧要)
  2. 通过GET https://www.googleapis.com/gmail/v1/users/me/drafts
  3. 查找草稿ID
  4. 通过正文{"id": "<draftId>"}
  5. 通过POST https://www.googleapis.com/gmail/v1/users/me/drafts/send发送草稿
  6. 返回Gmail并切换到新的Gmail UI,然后尝试在已发送"文件夹中打开最近发送的草稿.尝试打开消息将失败.
  7. 还原到旧的/经典的Gmail用户界面,然后在已发送"文件夹中打开最近发送的草稿.您将可以毫无问题地打开邮件.
  8. 收件人可以使用新的或旧的UI打开邮件而不会出现问题.
  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.

更新

当损坏的已发送电子邮件收到答复时,它似乎已被修复",发件人现在可以从新的Gmail用户界面打开已发送的电子邮件.这似乎表明REST API丢失了通过其他方式更新线程后会修复的问题?

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.

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

我无法重现此内容.注意,在再现步骤#2中是不必要的.相反,应该分析#1中的drafts.c​​reate()的结果,在那里显示新的草稿消息的ID.

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.

同样值得注意的是,草稿ID与消息ID不同. drafts.c​​reate()和drafts.update()的响应将是草稿ID,而drafts.send()的结果将是消息ID.在Gmail UI中查看已发送的邮件时,请确保您使用的是邮件ID.

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.