Code Review Bench PR #25477 - Removed unused tinybird filters#13
Code Review Bench PR #25477 - Removed unused tinybird filters#13ketkarameya wants to merge 6 commits intobase_pr_25477_20260125_2419from
Conversation
| if (!this._serverToken || this._isJWTExpired(this._serverToken)) { | ||
| const tokenData = this._generateToken({name, expiresInMinutes}); | ||
| this._serverToken = tokenData.token; | ||
| this._serverToken = tokenData; |
There was a problem hiding this comment.
🚨 Bug: Storing full tokenData object breaks caching and auth
The change from this._serverToken = tokenData.token to this._serverToken = tokenData stores the full {token, exp} object instead of the JWT string. This causes two cascading failures:
-
Token caching is broken: On line 96,
this._isJWTExpired(this._serverToken)passes the object tojwt.decode(), which expects a string.jwt.decode({token, exp})returnsnull, so_isJWTExpiredalways returnstrue, causing a new token to be generated on everygetToken()call. -
API authentication is broken: On line 102,
token: this._serverTokennests the object, returning{token: {token: "jwt...", exp: 12345}, exp: 12345}. Consumers likeservices/stats/utils/tinybird.jsdoconst token = tokenData?.token, getting the{token, exp}object instead of a string. This makesAuthorization: Bearer ${token}resolve toBearer [object Object], causing all Tinybird API requests to fail with authentication errors.
Similarly, api/endpoints/tinybird.js returns tokenData.token to the API response, which would be the nested object instead of a string.
Fix: Revert this line back to this._serverToken = tokenData.token; — the original code was correct.
Was this helpful? React with 👍 / 👎
| this._serverToken = tokenData; | |
| this._serverToken = tokenData.token; |
- Apply suggested fix
There was a problem hiding this comment.
Configure merge blocking · Maintainers can dismiss this review. Gitar never approves changes.
|
Note Gitar has paused automatic reviews. Comment "Gitar review" to trigger a review manually. Code Review 🚫 Blocked 0 resolved / 2 findingsCritical bug: storing the full 🚨 Bug: Storing full tokenData object breaks caching and auth📄 ghost/core/core/server/services/tinybird/TinybirdService.js:98 The change from
Similarly, Fix: Revert this line back to Suggested fix💡 Quality: ARCHITECTURE.md still references removed pipes📄 ghost/core/core/server/services/tinybird/TinybirdService.js:48
OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |
Benchmark Evaluation ResultsGround Truth Bugs (Recall: 2/5 = 40.0%)
Extra Gitar Findings
Summary
|
Benchmark PR for Gitar evaluation
Original PR: agentic-review-benchmarks#12
Removes unused Tinybird filter configurations to clean up codebase.