Comments (11)
Looking at this a bit more closely--it's by design. Express defaults to using using ETag's, which allow the server to determine whether the browser already has (cached) the content about-to-be returned by the server. If so, then the server alters the response to a 304 and omits the body, and the browser will simply use the body from its cache.
In my testing, in all cases where Glimpse captures a request returning 200 it also correctly captures the response body. In all cases where Glimpse captures a request returning 304, the response body is empty (as expected).
from home.
For this, is there something in the UI that we can show that more clearly indicates this was a 304 hence no body? Chet's expectation here is not unreasonable.
from home.
/cc @avanderhoorn @nikmd23 - would be curious to know what your experience was with glimpse v1.
Feel free to remove the beta/early beta tags if we feel this is too big.
from home.
@chetsangnil had created #8 related to indicating when no value--in particular, no body--exists. I imagine that this could piggypack on that. E.g. a (!)
icon next to a standard No body
text that, when clicked, shows a text bubble that indicates that a 304 response isn't expected to have a body.
from home.
I think there may be two issues here.
The first, as @chetsangnil articulated, I think should be solved by #8.
However, when I look at the message being generated, I'm surprised to see the status code is 200. In ETag situations, a 304 should be returned (which means "hey client, use the content you have in your cache, I'm not going to re-send it"). A 200 would indicate "hey client, what you have is stale, use this instead".
So it looks like we're showing a 200 when we should be showing a 304?
@chetsangnil, can you confirm by comparing what Glimpse is showing to what your browsers dev tools show? I can walk you through how to do that.
from home.
Totally my bad; must have been a long day. I kept reading @chetsangnil's response ETag (which happened to start with 304
) as the status code (listed directly below it). Copying his handler into my own sample app, I too see 200 responses with no body content captured by Glimpse (despite Chrome DevTools saying/showing a body was delivered).
I don't see this in the sample Sticker app, however.
from home.
In HttpProxy.ts
it seems like we're calling the HTTP server handling logic before attaching/patching the request/response events/functions, which may introduce a race condition that could miss response data
events. This seems to work for the Sticker sample app, but not for this simpler app. Maybe our sample tends to have large enough bodies to win the race?
If I move the invocation of the callback to after the subscription/patching, then Glimpse captures the body as expected. It looks like that code has been unchanged since @nebrius added body capturing, so he may have the best idea as to the intent of that ordering.
from home.
Ping @nebrius ;)
from home.
thanks @nikmd23. I noticed that this repo doesn't drop notifications in slack, can you update that?
from home.
Ok, looking at the code, I see what you're talking about. There's no specific reason it's ordered the way it is other than historical reasons, so it's fine to bump it to the bottom AFAIK. We should of course test for regressions.
from home.
Sorry it took me two weeks @nebrius, but this repo is now configured in Slack
from home.
Related Issues (20)
- [Hapi] Support roadmap HOT 7
- Support being initialized after imports HOT 4
- [Loopback] support HOT 6
- Glimpse breaks AWS-SDK S3 calls HOT 4
- Lost context reported using socket.io and/or sticky-session HOT 1
- TypeError: Cannot assign to read only property 'createGzip' of object '#<Object>' HOT 3
- Glimpse (Warning OlderUnsupportedPackageRequired): Glimpse does not support version 2.3.3 of debug. HOT 4
- Deep link to https://github.com/Glimpse/Home#package--version-support is broken HOT 1
- TypeError: Cannot assign to read only property 'createGzip' of object '#<Object>' HOT 3
- Use Glimpse with separate frontend and backend procceses? HOT 3
- Initializing Glimpse in projects break aws-sdk S3 HOT 4
- [Home repo]: update screenshot to reflect current UIs HOT 1
- Request entity too large - config setting doesn't help HOT 9
- Glimpse crashes acquiring mac address HOT 5
- TypeError: Converting circular structure to JSON at MessageConverter.js:38:43 HOT 1
- create-react-app and Glimpse cause can't resolve module glimpse-agent-node/release
- [restify] support?
- fatal error - ""could not find associated master data
- How can I get Glimpse to work with Vue.js/Nuxt.js ?
- support for mongodb version 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from home.