Sonarly Claude Code ec12597a1f ConsoleListener.release() accumulates wrapper chain causing stack overflow
https://sonarly.com/issue/5485?type=bug

Each logic function execution adds an extra wrapper layer to global console methods via ConsoleListener.release(), eventually exceeding V8's call stack limit after thousands of executions.

Fix: The `release()` method in `ConsoleListener` was creating a new arrow function wrapper around the captured original console method instead of directly restoring it. Each call to `release()` added one more layer to an ever-growing call chain, eventually causing a stack overflow after thousands of logic function executions.

The fix replaces the wrapper creation with a direct assignment:

```typescript file=packages/twenty-server/src/engine/core-modules/logic-function/logic-function-drivers/utils/intercept-console.ts lines=26-31
release() {
    Object.keys(this.originalConsole).forEach((method) => {
      // @ts-expect-error legacy noImplicitAny
      console[method] = this.originalConsole[method];
    });
  }
```

**Before:** Each `release()` call did `console[method] = (...args) => { this.originalConsole[method](...args) }` — creating a new closure that held a reference to the previous wrapper, forming a chain N layers deep after N executions.

**After:** Each `release()` call does `console[method] = this.originalConsole[method]` — directly restoring the reference captured at construction time, with no wrapper and no chain growth regardless of how many executions have occurred.
2026-03-04 01:31:35 +00:00
2025-08-07 17:02:12 +02:00
2025-07-08 15:13:02 +02:00
2026-03-04 00:50:06 +01:00
2026-02-25 10:35:46 +01:00
2026-03-04 00:50:06 +01:00
2026-03-04 00:50:06 +01:00
2026-03-04 00:50:06 +01:00

Twenty logo

The #1 Open-Source CRM

🌐 Website · 📚 Documentation · Roadmap · Discord · Figma


Cover


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

Companies Kanban Views

Customize your objects and fields

Setting Custom Objects

Create and manage permissions with custom roles

Permissions

Automate workflow with triggers and actions

Workflows

Emails, calendar events, files, and more

Other Features


Stack

Thanks

Chromatic Greptile Sentry Crowdin E2B

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

Languages
TypeScript 78%
MDX 18.5%
JavaScript 3.1%
Python 0.2%