Skip to content

fix: SendMailJob returns incorrect errors#1146

Merged
krishankumar01 merged 1 commit intomasterfrom
kkumar-gcc/mail-master
Jul 27, 2025
Merged

fix: SendMailJob returns incorrect errors#1146
krishankumar01 merged 1 commit intomasterfrom
kkumar-gcc/mail-master

Conversation

@krishankumar01
Copy link
Member

📑 Description

Closes https://github.com/goravel/goravel/issues/

✅ Checks

  • Added test cases for my code

Copilot AI review requested due to automatic review settings July 27, 2025 03:04
@krishankumar01 krishankumar01 requested a review from a team as a code owner July 27, 2025 03:04

This comment was marked as outdated.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.50.

Benchmark suite Current: 26371fc Previous: a5e38a6 Ratio
Benchmark_DecryptString 6430 ns/op 2032 B/op 16 allocs/op 2148 ns/op 2032 B/op 16 allocs/op 2.99
Benchmark_DecryptString - ns/op 6430 ns/op 2148 ns/op 2.99

This comment was automatically generated by workflow using github-action-benchmark.

@krishankumar01 krishankumar01 requested a review from Copilot July 27, 2025 03:07
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes incorrect parameter ordering and error messages in the SendMailJob.Handle method. The changes ensure that argument validation error messages correctly identify the expected parameter types and that the SendMail function is called with the correct parameter mapping.

  • Reorders argument parsing to match the expected SendMail function signature
  • Updates error messages to reflect the correct parameter names and types
  • Fixes the SendMail function call to use the correctly parsed arguments
Comments suppressed due to low confidence (1)

mail/job.go:60

  • The replyTo parameter is parsed from args[6] but is not being used in the SendMail function call on line 75. This suggests that either the parsing is incorrect or the SendMail call is missing the replyTo parameter.
	bcc, ok := args[6].([]string)

Copy link
Contributor

@hwbrzzl hwbrzzl left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

}

return SendMail(r.config, from, subject, body, recipient, cc, bcc, replyTo, attachments, convertSliceHeadersToMap(headers))
return SendMail(r.config, subject, body, fromAddress, fromName, to, cc, bcc, attachments, convertSliceHeadersToMap(headers))
Copy link
Contributor

Choose a reason for hiding this comment

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

It may be better to pass a struct here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I'll create a separate PR for these optimizations.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks, only for master should be fine.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, it’s a breaking change in some sense, at least since SendMail is an exposed method(not documented).

@krishankumar01 krishankumar01 merged commit a928a82 into master Jul 27, 2025
12 of 13 checks passed
@krishankumar01 krishankumar01 deleted the kkumar-gcc/mail-master branch July 27, 2025 04:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants