fix(communications): guard template list handlers when params are missing - #1567
Merged
Merged
Conversation
…sing Default call.request.params to an empty object in getTemplates and getCommunicationTemplates to avoid destructuring undefined on requests with no query string.
This was referenced Jul 31, 2026
kkopanidis
previously requested changes
Jul 31, 2026
kkopanidis
left a comment
Contributor
There was a problem hiding this comment.
Removing the reasonable defaults of skip 0 and limit 25 is an unwanted behavior. The APIs provide this default so users cannot accidentally request very large chunks of data. The rest of the parameters were already guarded, not so cleanly of course, but we must preserver the defaults
…dlers Preserve skip=0 and limit=25 when query params are missing while keeping the params null-guard that prevents 500s on unparameterized list requests.
kkopanidis
approved these changes
Aug 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
call.request.paramsto{}ingetTemplatesandgetCommunicationTemplates.undefinedwhen list requests arrive without query parameters.Why
GET /email/templateswith no query string could throw before the handler ran, returning a 500 instead of an empty or paginated result. This hardens the admin API against a class of request-shape failures seen when the Conduit UI loads templates on page entry.Related PR
Test plan
GET /email/templateswith no query params — returns 200 withtemplateDocumentsandcount.GET /communications/templateswith no query params — same behavior.