grammyjs / conversations

Conversational interfaces for grammY.
https://grammy.dev/plugins/conversations
MIT License
52 stars 17 forks source link

fix: clean up conversations #77

Closed ndatg closed 1 year ago

ndatg commented 1 year ago

I use MongoDBAdapter for sessions.

The conversation field in db becomes null when you exit the conversation. The code contains a strict check for undefined. Got an error: TypeError: Cannot convert undefined or null to object. Made some minor fix.

Fixes #63.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (b6bf872) 95.87% compared to head (0e3d957) 95.87%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #77 +/- ## ======================================= Coverage 95.87% 95.87% ======================================= Files 4 4 Lines 849 849 Branches 124 124 ======================================= Hits 814 814 Misses 33 33 Partials 2 2 ``` | [Impacted Files](https://app.codecov.io/gh/grammyjs/conversations/pull/77?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=grammyjs) | Coverage Δ | | |---|---|---| | [src/conversation.ts](https://app.codecov.io/gh/grammyjs/conversations/pull/77?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=grammyjs#diff-c3JjL2NvbnZlcnNhdGlvbi50cw==) | `95.44% <100.00%> (ø)` | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

KnorpelSenf commented 1 year ago

CI will need to be fixed before this can be merged. I won't do this tonight.

If you feel like looking into that, consider opening a second pull request. As soon as it's merged, we can sync this one with the upstream branch to fix CI. The changes performed here look good already.