lieer icon indicating copy to clipboard operation
lieer copied to clipboard

getProfile() for remote.get_current_history_id

Open bshanks opened this issue 3 years ago • 1 comments

Would it make sense for remote.get_current_history_id to be replaced with just:

return int(self.service.users().getProfile(userId = self.account).execute()['historyId'])

instead of doing what it current does (currently it first tries service.users.history.list passing startHistoryId, and if that doesn't work, for example if startHistoryId is not found, it retrieves one messages and takes the historyId from that)?

The reason i ask is that, like #203, with the current code i was caught in a "historyId is too old" loop, because apparently the historyId found from the first retrieved message is not always valid/current.

The reason i'm asking instead of submitting a patch is that i'm not sure i understand this very well.

bshanks avatar Feb 16 '22 09:02 bshanks

Hm, yeah, that sounds reasonable. That is probably the correct way to get the latest historyId.

gauteh avatar Feb 16 '22 21:02 gauteh