https://sonarly.com/issue/4153?type=bug When a user selects a record in the multi-select relation picker for a one-to-many field, the code attempts to read the target record from Apollo cache but fails because the record was fetched via search API and hasn't been fully cached yet. Fix: Replaced the hard `throw new Error('Could not find cached related record')` with a graceful `isDefined(cachedTargetRecord)` guard in `useRecordOneToManyFieldAttachTargetRecord.ts`. **What changed:** When `getRecordFromCache()` returns `null` (because the target record hasn't been hydrated into Apollo cache yet — common when records are found via search API), the code now skips the optimistic cache update and proceeds directly to the `updateOneRecord` API call. Previously it threw, which crashed the entire attach flow. **Why this is correct:** The cache update block (lines 62-98) is an optimistic UI optimization that updates the local Apollo cache to reflect the previous relation being cleared. It is not required for correctness — the `updateOneRecord` mutation (line 100) is what actually persists the relation change on the server. When the mutation response returns, Apollo will update the cache anyway. Also cleaned up the blank line in imports that was left by the original code. Note: Two unmerged branches already contain essentially identical fixes (`311ac35ddf` by neo773, `467621ba21` by Thomas Trompette), confirming this is a known issue with a consensus fix approach.
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!




