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: ctx.chat for callback queries #555

Merged
merged 6 commits into from
May 6, 2024
Merged

fix: ctx.chat for callback queries #555

merged 6 commits into from
May 6, 2024

Conversation

KnorpelSenf
Copy link
Member

Potential fix for https://t.me/grammyjs/228143

Copy link

codecov bot commented Apr 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 45.78%. Comparing base (4cb8e68) to head (aadc45e).
Report is 2 commits behind head on main.

❗ Current head aadc45e differs from pull request most recent head 25529fa. Consider uploading reports for the commit 25529fa to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #555      +/-   ##
==========================================
- Coverage   46.43%   45.78%   -0.65%     
==========================================
  Files          19       19              
  Lines        6121     5139     -982     
  Branches      330      331       +1     
==========================================
- Hits         2842     2353     -489     
+ Misses       3276     2784     -492     
+ Partials        3        2       -1     

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

@KnightNiwrem
Copy link
Contributor

KnightNiwrem commented Apr 9, 2024

To also fix in another PQ with similar "patterns" of code:

msgId: [Shortcuts<U>["msg"]] extends [object] ? number
Screenshot 2024-04-09 at 12 42 17 PM
Screenshot 2024-04-09 at 12 50 11 PM
Screenshot 2024-04-09 at 12 50 49 PM

businessConnectionId: [Shortcuts<U>["msg"]] extends [object] ? string | undefined
Screenshot 2024-04-09 at 12 44 24 PM

: [U["business_connection"]] extends [object] ? [U["business_connection"]["id"]]
Screenshot 2024-04-09 at 12 48 35 PM

: [U["deleted_business_messages"]] extends [object] ? [U["deleted_business_messages"]["business_connection_id"]]
Screenshot 2024-04-09 at 12 55 23 PM

@KnorpelSenf
Copy link
Member Author

Right, I'll fix those

@KnightNiwrem
Copy link
Contributor

All fixes for #555 (comment) has been verified.

Some regression bugs have surfaced.
Screenshot 2024-04-20 at 3 14 44 PM
Screenshot 2024-04-20 at 3 14 38 PM
Screenshot 2024-04-20 at 3 11 26 PM

@KnorpelSenf
Copy link
Member Author

All fixes for #555 (comment) has been verified.

Awesome!

Some regression bugs have surfaced. Screenshot 2024-04-20 at 3 14 44 PM Screenshot 2024-04-20 at 3 14 38 PM

Those two are invalid. There is no such field as id on a message, so the error is correct. You might have meant message_id which works correctly.

Screenshot 2024-04-20 at 3 11 26 PM

I cannot reproduce this. For me, ctx.chat is Chat | undefined which is correct.
image_2024-05-06_21-24-29

@KnorpelSenf KnorpelSenf merged commit f5c4cef into main May 6, 2024
6 checks passed
@KnorpelSenf KnorpelSenf deleted the fix-ctx-chat branch May 6, 2024 20:03
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.

None yet

3 participants