question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Firefox PATCH request only intercepted once

See original GitHub issue

Environment

Name Version
msw ^0.19.5
browser Firefox
OS MacOS

Request handlers

// Example of declaration. Provide your code here.
import { setupWorker, rest } from 'msw'

const worker = setupWorker(
  rest.patch('area-code', (req, res, ctx) => {
    return res(ctx.status(200), ctx.json({ ...req.body }))
  }),
  rest.patch('activate', (req, res, ctx) => {
    return res(ctx.status(200), ctx.json({}))
  }),
)

worker.start()

Actual request

fetch

// Example of making a request. Provide your code here.
useMutation(() => 
 fetch(`${baseUrl}${path}`, { headers, method, body }))

Current behavior

The PATCH request is only processed once. Either on the same route or a different route. This works fine in Chrome.

Expected behavior

Every request that matches should get intercepted.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
deshiknavescommented, Aug 5, 2020

Yep, I can’t recreate it on a new application even with the same route structure. I can on another application. Time for me to look at what version of dependencies are there. If it has anything to do with MSW, I’ll open this again.

It just fails to intercept the second call, but not an issue in Chrome.

1reaction
deshiknavescommented, Aug 4, 2020

@marcosvega91 I’ll see if I can get a repo up tomorrow with the issue in it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Show ServiceWorkers intercepted network requests in the ...
With this patch we show something in the devtools network panel. It doesn't work fully because of bug 1158533. Plus would be nice...
Read more >
Intercept HTTP requests - Mozilla - MDN Web Docs
To intercept HTTP requests, use the webRequest API. This API enables you to add listeners for various stages of making an HTTP request....
Read more >
Large response bodies (over 1MiB) are truncated, even in HAR
Bug 1223726 - Customize response body interception; ... Summary: currupted data dump - Network Monitor - Firefox Developer Tools → corrupted data dump ......
Read more >
log service worker interception errors to the console for non ...
Utility method for logging intercepted channel errors. Note, this is main thread only, though, so I will need some runnable bouncing in the...
Read more >
Security Vulnerabilities fixed in Firefox 107 - Mozilla
#CVE-2022-45405: Use-after-free in InputStream implementation ... #CVE-2022-45410: ServiceWorker-intercepted requests bypassed SameSite ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found