Skip to content

fix: respect DISABLE_FLOWISE_TELEMETRY env var for telemetry opt-out#6637

Open
zzhzhangzhihao wants to merge 2 commits into
FlowiseAI:mainfrom
zzhzhangzhihao:fix/disable-flowise-telemetry-env-var
Open

fix: respect DISABLE_FLOWISE_TELEMETRY env var for telemetry opt-out#6637
zzhzhangzhihao wants to merge 2 commits into
FlowiseAI:mainfrom
zzhzhangzhihao:fix/disable-flowise-telemetry-env-var

Conversation

@zzhzhangzhihao

Copy link
Copy Markdown

What

Makes the Telemetry constructor actually respect the DISABLE_FLOWISE_TELEMETRY environment variable.

Why

DISABLE_FLOWISE_TELEMETRY is documented as a telemetry opt-out in .env.example files, docker-compose files, and CLI flags. However, no code actually reads it. The only thing controlling telemetry was whether POSTHOG_PUBLIC_API_KEY is set.

Fix

Updated the Telemetry constructor in packages/server/src/utils/telemetry.ts to check DISABLE_FLOWISE_TELEMETRY before initializing PostHog. If the env var is 'true' or '1', telemetry is disabled regardless of POSTHOG_PUBLIC_API_KEY.

Related

exec-chain-4 added 2 commits July 17, 2026 17:42
- Previously only escaped/unescaped '-' character
- Now handles all RediSearch reserved characters: , . < > { } [ ] " ' : ; ! @ # $ % ^ & * ( ) - + = ~
- Fixes JSON.parse failure when metadata contains special characters (FlowiseAI#6598)
- Previously DISABLE_FLOWISE_TELEMETRY was documented in .env.example,
  docker-compose files, and CLI flags, but never actually checked in code.
- Only POSTHOG_PUBLIC_API_KEY controlled telemetry behavior.
- Now the Telemetry constructor checks DISABLE_FLOWISE_TELEMETRY before
  initializing PostHog, allowing users to opt out of telemetry as documented.

Fixes FlowiseAI#6618

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request introduces an opt-out mechanism for telemetry via the DISABLE_FLOWISE_TELEMETRY environment variable and expands the unEscapeSpecialChars utility in the Redis vector store to handle additional RediSearch special characters. A critical issue was identified in the unescaping logic where single and double quotes are not properly unescaped because the backslashes themselves are not escaped in the string literals, which will cause JSON parsing failures.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +41 to +42
'\"', '"',
"\'", "'",

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.

high

In JavaScript/TypeScript, the backslash in '\"' and "\'" acts as an escape character for the quote character itself within the string literal. Since double quotes do not need to be escaped inside single quotes (and vice versa), '\"' evaluates to " (length 1) and "\'" evaluates to ' (length 1).

As a result, the loop executes str.replaceAll('"', '"') and str.replaceAll("'", "'"), which does nothing and fails to unescape the actual backslash-escaped quotes (e.g., \" and \\') returned by Redis. This will cause JSON.parse to fail when parsing metadata containing quotes.

To fix this, escape the backslash itself so that the search strings are of length 2 (representing a literal backslash followed by a quote).

Suggested change
'\"', '"',
"\'", "'",
'\\"', '"',
"\\'", "'",

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.

DISABLE_FLOWISE_TELEMETRY is documented (.env/compose/CLI) but not read by any code — the opt-out has no effect

1 participant