Skip to content

Model quick replies as structs instead of strings #838

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

Merged
merged 1 commit into from
Feb 20, 2025

Conversation

rowanseymour
Copy link
Member

@rowanseymour rowanseymour commented Feb 19, 2025

But they can be unmarshaled from strings

HighPriority_ bool `json:"high_priority" db:"high_priority"`
Text_ string `json:"text" db:"text"`
Attachments_ pq.StringArray `json:"attachments" db:"attachments"`
QuickReplies_ pq.StringArray `json:"quick_replies" db:"quick_replies"`
Copy link
Member Author

Choose a reason for hiding this comment

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

we don't write or load messages with quick replies from the db

@@ -90,7 +90,7 @@ var sendTestCases = []OutgoingTestCase{
ExpectedRequests: []ExpectedRequest{
{
Path: "/discord/rp/send",
Body: `{"id":"10","text":"Hello World","to":"694634743521607802","channel":"bac782c2-7aeb-4389-92f5-97887744f573","attachments":[],"quick_replies":null}`,
Copy link
Member Author

Choose a reason for hiding this comment

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

sending arrays as nulls doesn't seem right...

Copy link

codecov bot commented Feb 19, 2025

Codecov Report

Attention: Patch coverage is 66.66667% with 23 lines in your changes missing coverage. Please review.

Project coverage is 74.65%. Comparing base (00d1c97) to head (780f2b5).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
msg.go 0.00% 8 Missing ⚠️
handlers/utils.go 0.00% 6 Missing ⚠️
backends/rapidpro/msg.go 16.66% 5 Missing ⚠️
test/msg.go 75.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #838      +/-   ##
==========================================
- Coverage   74.73%   74.65%   -0.09%     
==========================================
  Files         113      113              
  Lines       13295    13308      +13     
==========================================
- Hits         9936     9935       -1     
- Misses       2644     2658      +14     
  Partials      715      715              

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

@rowanseymour rowanseymour merged commit 63b0772 into main Feb 20, 2025
5 of 7 checks passed
@rowanseymour rowanseymour deleted the rich_quick_replies_pt1 branch February 20, 2025 17:17
@github-actions github-actions bot locked and limited conversation to collaborators Feb 20, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants