coder / coder/backstage-plugins
Coder plugin: clean up error-handling logic
- Dominant language
- TypeScript
- Stars
- 67
- Forks
- 9
- PR merge metrics
- No merged PRs in 30d
Description
The Coder plugin has some vestigial code from before we started using Axios. Now that we have Axios's `AxiosError`, there's far less of a need for the custom `BackstageHttpError`
In addition, the logic for spying on potentially-expired Coder session tokens can be cleaned up. The current code works, but when a Coder query fails, the plugin will make an entirely brand new request to revalidate the auth state. But if the error has a 401 status, we don't need to do that – we know that the session token is likely invalid, so we can mutate the query cache directly.
Tried to get these fixed really quickly in #132, but it started making the tests fail, so I decided to split this off into a separate issue.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating the Coder plugin's custom BackstageHttpError handling and the logic that checks potentially expired session tokens. Review the tests that failed in #132, then verify that AxiosError handling and the 401 query-cache path behave as intended without an extra request; done means the cleanup is covered by passing tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- authentication, developer-experience
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100