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

mongo storage to reduce PeerIdInvalid errors #442

Open
rking32 opened this issue Jan 13, 2022 · 5 comments
Open

mongo storage to reduce PeerIdInvalid errors #442

rking32 opened this issue Jan 13, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@rking32
Copy link
Member

rking32 commented Jan 13, 2022

Currently, all peer data are stored in the memory. Hence it is cleared in every restart. So better to save them in the database and fetch them when needed. With that, we can reduce PeerIdInvalid errors and increase user happiness :)

https://github.com/pyrogram/pyrogram/blob/master/pyrogram/storage/storage.py

@rking32 rking32 added the enhancement New feature or request label Jan 13, 2022
@Phyco-Ninja
Copy link
Collaborator

🤧 what are you gonna do about Auth key duplication error?

@rking32
Copy link
Member Author

rking32 commented Jan 17, 2022

will it be hard to handle?

@Phyco-Ninja
Copy link
Collaborator

not really, all it will need is new authentication method, something like, it extracts auth_key, dc_id, user_id and other stuffs from given pyro session key and update that in Mongo Storage. If new authentication method is implement correctly you can move all env to a collection in database. Maybe play around with this Mongo Storage Base

bash setup kinda thing. 🤒

@rking32
Copy link
Member Author

rking32 commented Jan 17, 2022

NIce. it's very good.

@Krishna-Singhal
Copy link
Collaborator

Krishna-Singhal commented Feb 6, 2022

PeerIdInvalid can also be reduce by using (link to profile) mention and extract user id from mention instead of using user id directly

Before I was also confused about this but after testing it's working and not won't raise PeerIdInvalid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants