chore!: remove api.ts unnecessary calls#22168
Merged
Merged
Conversation
api.ts unnecessary callsapi.ts unnecessary calls
jakehwll
commented
Feb 18, 2026
jeremyruppel
reviewed
Apr 6, 2026
jeremyruppel
approved these changes
Apr 21, 2026
Contributor
jeremyruppel
left a comment
There was a problem hiding this comment.
LGTM! calling out the 404 → 204 as a breaking change is the right thing to do, and I would be surprised if any other clients depend on the 404 response 👍
- Change previousTemplateVersion endpoint to return 204 instead of 404 when no previous version exists. - Add ErrNoPreviousVersion sentinel error in codersdk. - Remove unnecessary deployment stats queries when user lacks permission. - Add enabled guards for provisioner queries when organization is undefined. - Use Boolean() for react-query enabled props consistency. - Simplify TasksTable checkbox checked expression.
abd4c1d to
4308d3c
Compare
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Warning
The change of the status code from
404to204could break peoples code downstream. Adding this as a breaking change incase.Theres a whole ton of noise around failed requests, these are all unrelated to the actual thing that is broken at hand (and are confusing).
/api/v2/organizations/.../templates/.../versions/.../previousto return204instead of404(actually makes more sense because the content doesn't exist, but the route is found./api/v2/users/me/appearancewhen the user isn't logged in./api/v2/deployment/statswhen the deployment stats aren't allowed to be seen.workspace-sharingso we don't make unnecessary calls.Whats left:
/api/v2/users/mestill401s on the login page. This persists as when the user is logged in but tries to reach the sign-in page they should be redirected to the app, not sign in again.monaco-editoris still upset... we theoretically could inject an environment that can serve workers... but eh.Old
23 LOL(Lines of logs)New
9 LOL(Lines of logs)