Skip to content

Fix socket reset errors when counting#82

Merged
vedfi merged 1 commit into
vedfi:masterfrom
ondrejnedoma:master
Mar 8, 2026
Merged

Fix socket reset errors when counting#82
vedfi merged 1 commit into
vedfi:masterfrom
ondrejnedoma:master

Conversation

@ondrejnedoma

Copy link
Copy Markdown
Contributor

When trying to count the number of documents in several collections at once, an error is thrown for all the collections:

MongoService.getRecordCount: error for collection=xxx -> MongoDB ConnectionException: connection closed: The socket connection has been reset by peer.
I/flutter (22421): Possible causes:
I/flutter (22421): - Trying to connect to an ssl/tls encrypted database without specifiyng
I/flutter (22421): either the query parm tls=true or the secure=true parameter in db.open()
I/flutter (22421): - The server requires a key certificate from the client, but no certificate has been sent
I/flutter (22421): - Others

But it's actually none of those possible causes - perhaps this is only some DOS protection of mongodb.com and is not present on self-hosted databases, either way, the count requests being sent sequentially eliminates this issue 👍

@ondrejnedoma

Copy link
Copy Markdown
Contributor Author
Screenshot_20260306-172536_Mondroid

@vedfi

vedfi commented Mar 8, 2026

Copy link
Copy Markdown
Owner

Thank you so much for your contribution! I really appreciate that you not only found the bug but also fixed it. Great work! I’ll try to release the new version as soon as possible.

@vedfi vedfi merged commit f59bce9 into vedfi:master Mar 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants