Skip to content

fix(firestore-send-email): improve attachments validation error message#2583

Closed
HassanBahati wants to merge 9 commits into
nextfrom
@invertase/fix/firestore-send-email-improve-attachments-error-message
Closed

fix(firestore-send-email): improve attachments validation error message#2583
HassanBahati wants to merge 9 commits into
nextfrom
@invertase/fix/firestore-send-email-improve-attachments-error-message

Conversation

@HassanBahati

@HassanBahati HassanBahati commented Jan 12, 2026

Copy link
Copy Markdown
Contributor

Fixes #2550 (comment)

Adds a custom error message to attachmentsSchema when an object is provided instead of an array. The new message guides users to wrap single attachment objects in an array format.

HassanBahati and others added 4 commits December 2, 2025 14:32
…onStart event (#2562)

* fix(storage-resize-images): add missing recordStartEvent call

* feat(storage-resize-images): add onStorageResize event

* docs(storage-resize-images): update changelog

* chore(storage-resize-images): add onStartResize

* chore(storage-resize-images): add onStartResize event

---------

Co-authored-by: Tadej <tadej.dev@gmail.com>
Comment thread firestore-send-email/functions/src/validation.ts
if (issue.message && !issue.message.startsWith("Expected")) {
return issue.message;
}

@cabljac cabljac Jan 12, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actually i think a cleaner fix is I think in here we need

case "invalid_type":
  
  // Missing required field (received undefined)
  if (issue.received === "undefined") {
    return `Field '${path}' must be a ${issue.expected}`;
  }

  // Type mismatch cases
  if (issue.expected === "string") {
    return `Field '${path}' must be a string`;
  }
  if (issue.expected === "array") {
    return `Field '${path}' must be an array`;
  }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@HassanBahati did you push changes taking this approach? i dont see them

@cabljac

cabljac commented May 8, 2026

Copy link
Copy Markdown
Contributor

closing this as superseded

@cabljac cabljac closed this May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 [firestore-send-email] Delivery fails consistently with "Expected array, received object" (SMTP/Mandrill)

2 participants