fix(google): tell a stale grant to reconnect instead of calling it an upstream error - #89
Merged
Merged
Conversation
… upstream error A Google grant issued before a scope widened got upstream_error on the tools it now lacks, with nothing saying to reconnect. It was the one error the user could actually fix, reported as the one they could not. Google spends 403 on two unrelated things: a scope the grant never got, and an API that was never enabled. errors.forbidden mapped both to upstream_error, which is right for the second and a dead end for the first. bodyFailure runs ahead of the 403 arm, so the reason inside the error body separates them, and SERVICE_DISABLED keeps falling through to upstream_error. gdrive has been in this state since #35 widened it to auth/drive, and #84 put gmail and gcal there too, so all three carry the rule. Closes #88
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.
A Google grant issued before a scope widened got
upstream_erroron the tools it now lacks, and nothing in that answer said to reconnect.gdrivehas been in that state since #35; #84 putgmailandgcalthere too, so it is live onmainfor every existing Google connection right now.Google spends 403 on two unrelated things: a scope the grant never got, and an API that was never enabled.
errors.forbiddenmapped both toupstream_error, which is right for the second and a dead end for the first.bodyFailurealready runs ahead of the 403 arm (manifest.ts:610), so the reason inside the error body separates them with no executor change.SERVICE_DISABLEDis not incodes, so it keeps falling through toupstream_error, and a 401 reportsUNAUTHENTICATEDinerror.statussobodyFailurenever fires on it.Closes #88
Evidence
Three tests, run across all three google prefixes: the missing scope becomes
reauth_required, the disabled API staysupstream_error, and a 401 is still handled by the arm that already had it.Broken deliberately,
codesemptied on gmail:Restored, full suite:
Not verified
insufficientPermissionsis the reason string from Google's documented error shape, not one observed on a live 403. The tests prove the wiring, not the string. Whoever runs the first real reconnect should check it against an actual refusal, because if the string is wrong this silently keeps the old behaviour rather than failing loudly.