Skip to content

fix: remove the instance ID from the news request - #615

Open
sandroqdb wants to merge 1 commit into
mainfrom
fix/news-panel-instance-id
Open

sandroqdb wants to merge 1 commit into
mainfrom
fix/news-panel-instance-id

Conversation

@sandroqdb

Copy link
Copy Markdown

Problem

The News panel requests cloud.questdb.com/api/news?category=enterprise&telemetryUserId=<id> when it mounts and every time the window gets focus.

  • It always sends undefined. getEnterpriseNews reads telemetryConfig from the first render, and the useEffect that calls it (and registers it as the focus listener) has [] deps. The config only loads after QuestProvider dispatches telemetry.start(), so on that render it is still undefined. Every request therefore sends telemetryUserId=undefined, both on load and on focus. This was checked on demo.questdb.io and has been the case since at least feat(web-console): general UI refresh, new News UI, new CSV Import UI #199 (Nov 2023).
  • Targeted news doesn't work. The endpoint (saas-client pages/api/news.ts) uses the ID to show Airtable news items targeted at specific instances (telemetryUserIds). With undefined, only untargeted items come back.
  • A plain fix would leak the ID. The request never checks telemetry.enabled. Fixing the stale closure on its own would start sending the instance ID even when telemetry is off, which the privacy notice (questdb/questdb.io#3033) and the telemetry docs don't allow.

This PR

Option A: remove the ID from the request. News works as it does today, and everyone sees the untargeted items.

Alternative

Option B: fix the closure (read the current config through a ref, or add telemetryConfig to the deps), and add telemetryUserId only when telemetryConfig.enabled is true. This brings targeted news back for instances with telemetry on. Choose it if targeted news is still wanted.

Either way

  • The endpoint lives on cloud.questdb.com, which is going away with the Cloud shutdown, so news needs a new home before then. The feedback form posts to cloud.questdb.com/api/feedback as well.
  • pages/api/news.ts puts category and telemetryUserId into the Airtable filterByFormula without escaping them. Worth fixing when the endpoint moves.

Checks

  • yarn typecheck: passes.
  • eslint and prettier --check on the changed files: pass.
  • vitest related on both files: 48 files, 1542 tests passed.
  • The e2e intercept (/api/news*) still matches.

🤖 Generated with Claude Code

The News panel sent telemetryUserId with every news request, but the
handler captured telemetryConfig on the first render, before it loads,
so the value was always "undefined". Fixing only the stale closure would
start sending the instance ID even when telemetry is switched off, so
drop it from the request instead.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown

Web Console deploy preview

Preview Commit Logs
https://pr-615--web-console.netlify.app 957a3cb build log

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.

1 participant