Double redirect results in no toast message

Open
#42 4 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
typescript

Research direction

Start by reproducing the deep URL flow through the loaders: /route/sub-route redirects to /route, which redirects again to /. Inspect the redirectWithError calls and the existing toast middleware tests. Done means the toast message is displayed after the second redirect, with coverage for this nested access-control case.

Written by the indexing model from the issue text.

Description

After migrating to using toast middleware, we have a regression where we have some access controls in our loaders and redirect to parent routes if no access is allowed.

Our tests have picked up an edge case where a direct url is used to a deep page /route/sub-route which kicks the user back to /route if they don’t have access for that page either and immediately redirected for a second time to / then no toast is displayed.

Our code was using return redirectWithError, I have also tried to change to return await redirectWithError and throw await redirectWithError but neither seems to being the toast message back.

Dominant language
TypeScript
Stars
260
Forks
15
PR merge metrics
No merged PRs in 30d

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from code-forge-io/remix-toast

All issues in code-forge-io/remix-toast

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.