fix: Misc billing, error handling and UX improvements#2014
Merged
charlesvien merged 8 commits intomainfrom May 4, 2026
Merged
Conversation
Contributor
Prompt To Fix All With AIFix the following 3 code review issues. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 3
apps/code/src/renderer/api/fetcher.ts:66-72
In HTTP/2 connections (which are standard for modern HTTPS APIs), `response.statusText` is always an empty string per the Fetch spec, so the fallback produces `{"error":""}` — useless for diagnostics. Cloning the response before calling `.json()` lets the catch handler read the raw body text instead, giving actual content for non-JSON error payloads. The same pattern applies to both catch sites.
```suggestion
} catch {
const cloned = response.clone();
const errorResponse = await response
.json()
.catch(() => cloned.text().then((t) => ({ error: t || response.statusText })));
throw new Error(
`Failed request: [${response.status}] ${JSON.stringify(errorResponse)}`,
);
```
### Issue 2 of 3
apps/code/src/renderer/api/fetcher.ts:76-82
Same HTTP/2 `statusText` issue as in the 401 retry path above — the fallback will always yield `{"error":""}`. Cloning the response first preserves the body for a text fallback.
```suggestion
if (!response.ok) {
const cloned = response.clone();
const errorResponse = await response
.json()
.catch(() => cloned.text().then((t) => ({ error: t || response.statusText })));
throw new Error(
`Failed request: [${response.status}] ${JSON.stringify(errorResponse)}`,
);
```
### Issue 3 of 3
apps/code/src/renderer/features/settings/components/sections/PlanUsageSettings.tsx:243-244
**Hardcoded expiry date will go stale**
The date "June 4, 2026" is hard-coded in the UI copy. Today is 2026-05-04 — that's approximately 30 days away. Once the date passes, users will see text claiming they have free Pro access "until June 4, 2026" even if the plan has been extended, expired, or changed. This should be driven by a value from the API/config so it can be updated without a new release, or at minimum there should be a plan to update this copy before that date.
Reviews (1): Last reviewed commit: "Show update indicator on pre-auth screen..." | Re-trigger Greptile |
adboio
approved these changes
May 4, 2026
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
Assorted fixes across billing, API error handling and pre-auth screens.
Changes
How did you test this?
Manually