Repository navigation
Conversation
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>
Web Console deploy preview
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The News panel requests
cloud.questdb.com/api/news?category=enterprise&telemetryUserId=<id>when it mounts and every time the window gets focus.undefined.getEnterpriseNewsreadstelemetryConfigfrom the first render, and theuseEffectthat calls it (and registers it as the focus listener) has[]deps. The config only loads afterQuestProviderdispatchestelemetry.start(), so on that render it is stillundefined. Every request therefore sendstelemetryUserId=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).saas-clientpages/api/news.ts) uses the ID to show Airtable news items targeted at specific instances (telemetryUserIds). Withundefined, only untargeted items come back.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
telemetryConfigto the deps), and addtelemetryUserIdonly whentelemetryConfig.enabledis true. This brings targeted news back for instances with telemetry on. Choose it if targeted news is still wanted.Either way
cloud.questdb.com/api/feedbackas well.pages/api/news.tsputscategoryandtelemetryUserIdinto the AirtablefilterByFormulawithout escaping them. Worth fixing when the endpoint moves.Checks
yarn typecheck: passes.eslintandprettier --checkon the changed files: pass.vitest relatedon both files: 48 files, 1542 tests passed./api/news*) still matches.🤖 Generated with Claude Code