Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getProfile() for remote.get_current_history_id #213

Open
bshanks opened this issue Feb 16, 2022 · 1 comment
Open

getProfile() for remote.get_current_history_id #213

bshanks opened this issue Feb 16, 2022 · 1 comment

Comments

@bshanks
Copy link
Contributor

bshanks commented Feb 16, 2022

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.

@gauteh
Copy link
Owner

gauteh commented Feb 16, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants