fix(work-tracker): check res.ok on delete ops before toasting success#72
Open
Chzhqv wants to merge 1 commit into
Open
fix(work-tracker): check res.ok on delete ops before toasting success#72Chzhqv wants to merge 1 commit into
Chzhqv wants to merge 1 commit into
Conversation
Three deletes (session, expense, route) fired the DELETE request then unconditionally toasted success and refreshed, with no res.ok check and no .catch. A failed delete still showed "deleted", and a rejected fetch was an unhandled promise rejection. Added a regression test suite covering all three delete handlers across fail/success/reject paths (confirmed it fails without the fix, passes with it). Fixes TemaDeveloper#21
|
Someone is attempting to deploy a commit to the Artemii's projects Team on Vercel. A member of the Team first needs to authorize it. |
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.
Summary
work-tracker.tsx(session, expense, route) fired the DELETE request then unconditionally toasted success and calledrouter.refresh(), with nores.okcheck and no.catch.res.ok(error toast + no refresh on failure) and catch rejected fetches.Test plan
work-tracker/__tests__/work-tracker-delete.test.tsx) covering all 3 delete handlers across fail/success/network-reject paths (9 cases) — confirmed it fails without the fix (6/9 fail with unhandled rejections) and passes with it (9/9)pnpm lint,tsc --noEmit, fullvitest run(565/565) all passFixes #21