0
votes

There appears to be some undocumented factors that can trigger a history change in the Gmail API.

The Gmail API sync docs say...

History records provide a list of IDs for messages that have been added, deleted, or had their labels modified since the time of the startHistoryId.

See https://developers.google.com/gmail/api/guides/sync

...however, it appears that a new history record is created when you reopen a previously viewed message/thread from the native Gmail desktop UI.

Can someone on the Gmail API team confirm this?

And if so, what other undocumented events trigger a new history record?

BTW: Are there plans to modify the history list resource so that it returns an immutable event log of the state changes so that the state changes could be replayed?

1

1 Answers

2
votes

A history change is written for a message any time the labels on it change. Marking it as UNREAD and then read would definitely cause this. There are also some labels not visible externally that could be modified that would cause the message to show up in the history log, though that's uncommon.

Anything that changes the mailbox generates a history record, not every change to the mailbox is externally visible.

Making the history.list() return more details is something that's being looked at.