feat: add native contact conversation filtering - #38
Conversation
|
Merging this branch will increase overall coverage
Coverage by fileChanged files (no unit tests)
Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code. Changed unit test files
|
|
@codex please review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6f37b8c8c8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| filters = appendConversationFilter(filters, "assignee_id", "is_present") | ||
| case "unassigned": | ||
| filters = appendConversationFilter(filters, "assignee_id", "is_not_present") |
There was a problem hiding this comment.
Use documented operators for assignment-state filters
When --assignee assigned or --assignee unassigned is combined with --contact (including through contact <id> conversations), these branches send is_present or is_not_present. The pinned Chatwoot Conversations Filter contract in internal/sdk/testdata/application_swagger.json:3092-3100 permits only equal_to, not_equal_to, contains, and does_not_contain, so a server enforcing the documented contract rejects these advertised filters with HTTP 400. Encode the assignment state using a supported filter representation or remove these options from the contact-filter path.
Useful? React with 👍 / 👎.
| }) | ||
| var resp *sdk.ConversationsListResponse | ||
| var err error | ||
| if c.Contact > 0 { |
There was a problem hiding this comment.
Reject nonpositive contact flag values
When a caller explicitly supplies --contact 0 or a negative ID, this condition treats the flag as absent and executes the ordinary conversation-list request, potentially returning unrelated conversations instead of reporting invalid input. This also bypasses the ContactID <= 0 validation in filterConversations, so scripts can silently operate on the wrong result set; track whether the flag was supplied or validate it before choosing the request path.
Useful? React with 👍 / 👎.
Summary
Verification
Testing