https://sonarly.com/issue/26908?type=bug When users select "Some folders" and pick specific subfolders for Microsoft/Outlook email sync, ALL emails are imported because the backend only discovers top-level mail folders from the Microsoft Graph API and never finds the user-selected child folders. Fix: Added recursive child folder discovery to MicrosoftGetAllFoldersService. The existing code only called /me/mailFolders which returns top-level Microsoft mail folders. When a user selected "Some folders" and picked a subfolder (e.g., "Inbox/Twenty"), that subfolder was never discovered by the backend, so it could never have isSynced=true, and the isSynced filter in the message list service would find zero matching folders. The fix adds a private fetchFoldersRecursively method that checks each folder's childFolderCount (already present in the Microsoft Graph API response and already typed in MicrosoftGraphFolder). For folders with children, it calls /me/mailFolders/{id}/childFolders to fetch nested folders, and recurses for any deeper nesting. The error handling follows the same .catch() pattern used for the top-level folder fetch — errors are logged and return empty results rather than breaking the entire sync. The downstream isSynced filtering in MicrosoftGetMessageListService (line 41-44) already correctly filters folders when SELECTED_FOLDERS policy is active, and the early-exit guard (line 47) already returns empty when no folders match. The only missing piece was that child folders were never discovered in the first place.
The #1 Open-Source CRM
🌐 Website · 📚 Documentation · Roadmap ·
Discord ·
Figma
Installation
See: 🚀 Self-hosting 🖥️ Local Setup
Why Twenty
We built Twenty for three reasons:
CRMs are too expensive, and users are trapped. Companies use locked-in customer data to hike prices. It shouldn't be that way.
A fresh start is required to build a better experience. We can learn from past mistakes and craft a cohesive experience inspired by new UX patterns from tools like Notion, Airtable or Linear.
We believe in open-source and community. Hundreds of developers are already building Twenty together. Once we have plugin capabilities, a whole ecosystem will grow around it.
What You Can Do With Twenty
Please feel free to flag any specific needs you have by creating an issue.
Below are a few features we have implemented to date:
- Personalize layouts with filters, sort, group by, kanban and table views
- Customize your objects and fields
- Create and manage permissions with custom roles
- Automate workflow with triggers and actions
- Emails, calendar events, files, and more
Personalize layouts with filters, sort, group by, kanban and table views
Customize your objects and fields
Create and manage permissions with custom roles
Automate workflow with triggers and actions
Emails, calendar events, files, and more
Stack
- TypeScript
- Nx
- NestJS, with BullMQ, PostgreSQL, Redis
- React, with Jotai, Linaria and Lingui
Thanks
Thanks to these amazing services that we use and recommend for UI testing (Chromatic), code review (Greptile), catching bugs (Sentry) and translating (Crowdin).
Join the Community
- Star the repo
- Subscribe to releases (watch -> custom -> releases)
- Follow us on Twitter or LinkedIn
- Join our Discord
- Improve translations on Crowdin
- Contributions are, of course, most welcome!




