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

Fix mongo database error #2015

Merged
merged 2 commits into from Apr 25, 2024
Merged

Fix mongo database error #2015

merged 2 commits into from Apr 25, 2024

Conversation

st01cs
Copy link
Contributor

@st01cs st01cs commented Nov 29, 2023

Description

response = await self.database[self.collection].find_one()

[response] will be None when cant find document in collection, response.key() will throw exception.

Status

READY

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Find an document which does not exist in collection, Opsdroid will not be broken.

Checklist:

  • [ *] I have performed a self-review of my own code
  • [ *] I have made corresponding changes to the documentation (if applicable)
  • [ *] I have added tests that prove my fix is effective or that my feature works
  • [ *] New and existing unit tests pass locally with my changes

Copy link

codecov bot commented Nov 29, 2023

Codecov Report

Attention: Patch coverage is 50.00000% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 99.14%. Comparing base (e2ffb0c) to head (ff31730).
Report is 6 commits behind head on master.

❗ Current head ff31730 differs from pull request most recent head 3c375ba. Consider uploading reports for the commit 3c375ba to get more accurate results

Files Patch % Lines
opsdroid/database/mongo/__init__.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2015      +/-   ##
==========================================
- Coverage   99.16%   99.14%   -0.02%     
==========================================
  Files          83       83              
  Lines        5395     5397       +2     
==========================================
+ Hits         5350     5351       +1     
- Misses         45       46       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@jacobtomlinson jacobtomlinson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay in reviewing here. Thanks!

@jacobtomlinson jacobtomlinson enabled auto-merge (squash) April 25, 2024 10:32
@jacobtomlinson jacobtomlinson merged commit 2a82325 into opsdroid:master Apr 25, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants