Added materialized view and duplicated v2 Tinybird endpoints#23
Conversation
…re robust polling approach
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| return `${baseUrl}/v0/pipes/${endpointName}.json?${params}`; | ||
|
|
||
| // Append version suffix if provided (e.g., "v2" -> "api_kpis_v2") | ||
| const finalEndpointName = config.version ? `${config.version}_${endpointName}` : endpointName; |
There was a problem hiding this comment.
Version suffix ordering produces incorrect endpoint URLs
High Severity
The version suffix is prepended instead of appended to the endpoint name. The code produces v2_api_kpis but the actual Tinybird endpoint files are named api_kpis_v2.pipe. The comment on line 17 even states the expected format "e.g., 'v2' -> 'api_kpis_v2'" but the implementation does the opposite. The server-side code in tinybird.js correctly uses ${pipeName}_${version}, creating an inconsistency between client and server URL construction that will cause 404 errors.
| if (options.source !== undefined) { | ||
| tinybirdOptions.source = options.source; | ||
| } | ||
|
|
There was a problem hiding this comment.
Source filter silently removed from top content API
Medium Severity
The source filter handling was removed from fetchRawTopContentData but source remains in the API options list in stats.js and is documented in the JSDoc at line 37. The Tinybird pipes (filtered_sessions.pipe and filtered_sessions_v2.pipe) still support source filtering via {% if defined(source) %}. Users can pass source parameters to filter by traffic source but the filter will be silently ignored since source is never added to tinybirdOptions.
Benchmark PR from qodo-benchmark#232
Note
Implements MV-backed analytics and config-driven endpoint versioning.
_mv_session_data_v2andmv_session_data_v2.pipe, plusfiltered_sessions_v2.pipeto derive session-level attributes via*Mergecombinatorsv2endpoints: Addsapi_kpis_v2,api_active_visitors_v2,api_post_visitor_counts_v2,api_top_{locations,pages,sources,utm_sources,utm_mediums,utm_campaigns,utm_contents,utm_terms,devices}_v2and registers them inTinybirdServiceStatsConfig.versionand updates request builders (stats-config.ts, servertinybird.js) to usepipe_vXnaming; removestb_versionfrom server API/options and updates unit testsv2endpointsFrameworkProvidercontext provider JSXWritten by Cursor Bugbot for commit 4bc9eeb. Configure here.