refactor: align delete method with other HTTP methods in Resend class#904
Open
wesleyramalho wants to merge 2 commits intoresend:canaryfrom
Open
refactor: align delete method with other HTTP methods in Resend class#904wesleyramalho wants to merge 2 commits intoresend:canaryfrom
delete method with other HTTP methods in Resend class#904wesleyramalho wants to merge 2 commits intoresend:canaryfrom
Conversation
The `delete` method was inconsistent with `post`, `get`, `put`, and `patch` — it didn't support custom headers/options and unconditionally stringified the body even when undefined. Now follows the same pattern.
Contributor
There was a problem hiding this comment.
1 issue found across 3 files
Confidence score: 3/5
- There is a concrete regression risk in
src/resend.ts: DELETE body serialization now uses a truthiness check onquery, which can drop valid falsy payloads (for example0orfalse). - Given the 5/10 severity with high confidence (9/10), this is a moderate user-impacting behavior change rather than a merge-blocking failure, so the PR carries some risk.
- Pay close attention to
src/resend.ts- ensure DELETE request body handling preserves intentionally provided falsy values.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/resend.ts">
<violation number="1" location="src/resend.ts:225">
P2: DELETE body serialization now incorrectly omits valid falsy payloads due to a truthiness check on `query`.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Avoid omitting valid falsy payloads (null, 0, "", false) by using an explicit `=== undefined` check instead of a truthiness check.
Author
|
@cubic-dev-ai can you review again? |
Contributor
@wesleyramalho I have started the AI code review. It will take a few minutes to complete. |
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.
The
deletemethod was inconsistent withpost,get,put, andpatch— it didn't support custom headers/options and unconditionally stringified the body even when undefined. Now follows the same pattern.Summary by cubic
Aligns the
deletemethod with other HTTP methods inResendby adding options/header support and only sending a body when provided. Uses a strict undefined check to preserve valid falsy payloads.Refactors
DeleteOptionsinterface.delete()acceptsoptions, merges custom headers with defaults.querywhen defined; omits body otherwise.Bug Fixes
=== undefinedcheck sonull,0,"", andfalseare sent correctly.Written for commit cad9aa8. Summary will update on new commits.