Skip to content

How to bypass requests on the worker level? #1424

Answered by kettanaito
jkieboom asked this question in Q&A
Discussion options

You must be logged in to vote

Hey, @jkieboom. Thanks for raising this.

I understand the extra journey to the worker and back may have implications like latency but it's rather challenging to circumvent it entirely. When using MSW, the request flow is:

  1. Request client dispatched a request;
  2. Request hits the Network;
  3. Request hits the "fetch" event of the worker;
  4. The worker signals request info to the client;
  5. The clients responds to the worker on what it should do with the request;
  6. The worker proceeds with the request (either mocks it or bypasses it).

We cannot skip points 2 and 3 because the client won't be able to know anything about the request then.

The whitelist of endpoints is data. The only way to pass the data to…

Replies: 2 comments 8 replies

Comment options

You must be logged in to vote
5 replies
@jkieboom
Comment options

@kettanaito
Comment options

@jkieboom
Comment options

@kettanaito
Comment options

@kettanaito
Comment options

Answer selected by kettanaito
Comment options

You must be logged in to vote
3 replies
@kettanaito
Comment options

@jkieboom
Comment options

@kettanaito
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants
Converted from issue

This discussion was converted from issue #1423 on October 04, 2022 10:49.