Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expose tracking server response for client to consume #26

Open
rayshan opened this issue Jul 27, 2014 · 3 comments
Open

expose tracking server response for client to consume #26

rayshan opened this issue Jul 27, 2014 · 3 comments

Comments

@rayshan
Copy link
Contributor

rayshan commented Jul 27, 2014

Insight should pass the response from tracking server, just in case the client wants to consume this info. Currently tracking server response is ignored: https://github.com/yeoman/insight/blob/master/lib/push.js#L23

There should also be tests that validate tracking server response.

GA tracking server response headers:

HTTP/1.1 200 OK
Pragma: no-cache
Expires: Mon, 07 Aug 1995 23:30:00 GMT
Cache-Control: private, no-cache, no-cache=Set-Cookie, proxy-revalidate
Access-Control-Allow-Origin: *
Last-Modified: Sun, 17 May 1998 03:00:00 GMT
X-Content-Type-Options: nosniff
Content-Type: image/gif
Date: Sun, 27 Jul 2014 00:00:40 GMT
Server: Golfe2
Content-Length: 35
Alternate-Protocol: 443:quic

Response body has a 1x1 pixel image.

@sindresorhus
Copy link
Member

Do you have an actual need and use-case for this?

@rayshan
Copy link
Contributor Author

rayshan commented Jul 27, 2014

I was thinking about writing tests for bower's tracking. It would be nice to know if tracking attempt was successful or not. Perhaps we don't need to return the entire server response, just success / fail.

After looking at it closer, this may be harder to implement due to Insight forking multiple tracking attempts into child processes. Do you know why this is the case instead of using an async control flow? My understanding is that fork spawns entirely new V8 instances, and is meant to be used for heavy-lifting tasks.

@sindresorhus
Copy link
Member

Do you know why this is the case instead of using an async control flow?

It's like that so it can be fault tolerant and have no impact on the consumer. If you send something and then immediately quit the process it still sends successfully as the sending happens in an independent child process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants