Skip to content

fixing a microsoft graph api error #12154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 21, 2025
Merged

fixing a microsoft graph api error #12154

merged 2 commits into from
May 21, 2025

Conversation

guillim
Copy link
Contributor

@guillim guillim commented May 21, 2025

The issue is "Microsoft Graph API unknown error: TypeError: Cannot read properties of undefined (reading 'emailAddress')"

Sentry : https://twenty-v7.sentry.io/issues/6605750776/events/7feb4f5949a64ab78bb429cffb7f0fea/?project=4507072499810304

Fixes twentyhq/core-team-issues#981

@guillim guillim self-assigned this May 21, 2025
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR fixes Microsoft Graph API error handling by adding null checks for email addresses in the message import service.

  • Added .filter(Boolean) to toRecipients, ccRecipients, and bccRecipients in packages/twenty-server/src/modules/messaging/message-import-manager/drivers/microsoft/services/microsoft-get-messages.service.ts to prevent undefined values
  • Added fallback empty string for from.emailAddress.address to handle cases where sender information is missing
  • Added participant email validation check with handle.includes('@') to ensure only valid email addresses are processed

1 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

Copy link
Contributor

github-actions bot commented May 21, 2025

🚀 Preview Environment Ready!

Your preview environment is available at: http://bore.pub:8440

This environment will automatically shut down when the PR is closed or after 5 hours.

@guillim guillim moved this to 🏗 In Progress in 🎯 Roadmap & Sprints May 21, 2025
@guillim guillim requested a review from charlesBochet May 21, 2025 08:57
@charlesBochet charlesBochet merged commit 6ff5a5b into main May 21, 2025
37 checks passed
@github-project-automation github-project-automation bot moved this from 🏗 In Progress to 🔦 In QA in 🎯 Roadmap & Sprints May 21, 2025
@charlesBochet charlesBochet deleted the emailAddress-undefined branch May 21, 2025 09:04
@guillim guillim moved this from 🔦 In QA to ✅ Done in 🎯 Roadmap & Sprints May 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Unknown: Microsoft driver error:
3 participants