-
-
Notifications
You must be signed in to change notification settings - Fork 539
fix: Handle 403 VALIDATION_REQUIRED error and prevent "Body already used" #356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -173,7 +173,14 @@ export interface AccountStorage { | |
| activeIndex: number; | ||
| } | ||
|
|
||
| export type CooldownReason = "auth-failure" | "network-error" | "project-error"; | ||
| /** | ||
| * Reasons why an account may be cooling down. | ||
| * - "auth-failure": Authentication/token refresh failed | ||
| * - "network-error": Network connectivity issues | ||
| * - "project-error": Project ID resolution failed | ||
| * - "validation-required": Google requires account verification (403 PERMISSION_DENIED with VALIDATION_REQUIRED) | ||
| */ | ||
| export type CooldownReason = "auth-failure" | "network-error" | "project-error" | "validation-required"; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
Without the Prompt To Fix With AIThis is a comment left during a code review.
Path: src/plugin/storage.ts
Line: 183:183
Comment:
The `validation-required` cooldown reason is added here, but the actual implementation in `src/plugin.ts` that handles 403 VALIDATION_REQUIRED errors is missing from this PR. According to the PR description, code needs to be added before line 1616 in `plugin.ts` to:
1. Clone the 403 response
2. Check for VALIDATION_REQUIRED reason
3. Mark the account as cooling down
4. Switch to another account
Without the `plugin.ts` changes, this type addition has no effect.
How can I resolve this? If you propose a fix, please make it concise. |
||
|
|
||
| export interface AccountMetadataV3 { | ||
| email?: string; | ||
|
|
@@ -189,6 +196,8 @@ export interface AccountMetadataV3 { | |
| cooldownReason?: CooldownReason; | ||
| /** Per-account device fingerprint for rate limit mitigation */ | ||
| fingerprint?: import("./fingerprint").Fingerprint; | ||
| /** History of previous fingerprints for this account */ | ||
| fingerprintHistory?: import("./fingerprint").FingerprintVersion[]; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Verify that the Prompt To Fix With AIThis is a comment left during a code review.
Path: src/plugin/storage.ts
Line: 200:200
Comment:
Verify that the `FingerprintVersion` type is exported from `src/plugin/fingerprint.ts` and is being used correctly by the `fingerprintHistory` consumers in `src/plugin/accounts.ts`. The type import looks correct, but verify that all existing fingerprint history code is compatible with this schema addition.
How can I resolve this? If you propose a fix, please make it concise. |
||
| } | ||
|
|
||
| export interface AccountStorageV3 { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant clone -
extractRetryInfoFromBodyalready clones the response internally (line 538). Passresponsedirectly.Prompt To Fix With AI