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

Implement toJson on ReactServerAgent request for logging/debugging #610

Merged
merged 1 commit into from
Aug 26, 2016

Conversation

doug-wade
Copy link
Collaborator

queryParams: this._queryParams,
timeout: this._timeout,
type: this._type,
urlPath: this._urlPath,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just slapped everything into the json that I could find on this -- lemme know if I missed anything.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM.

@roblg - Do I remember you adding some special handling for this outside of React Server core?

Any conflict here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gigabo It's possible 😁. I don't recall anything though. There's some special handling of ReactServerAgent responses in Cache.js (sibling to Request.js), and there's some special handing of error objects in Redfin-internal code, but I don't think I recall any Request-related handling.

@doug-wade there's also a _cacheWhitelist property (whose name doesn't make any sense unless you look at the implementation) that includes an array of headers that we're interested in from the response. It's technically state on the request; not sure if it's in interesting in a JSON representation of the request.

Somewhat related, are we sure we want to include the raw agent object in a toJSON method? If set, it's a node HTTP Agent, which doesn't really seem JSON-y to me (though maybe it has properties we want to expose?)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch @roblg. Gotta get your eyes on more PRs here! 👀

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@roblg Thanks! I've removed _agent and added _cacheWhitelist

@doug-wade doug-wade changed the title Fix #228: Implement toJson on ReactServerAgent request for logging/debugging Implement toJson on ReactServerAgent request for logging/debugging Aug 23, 2016
@gigabo gigabo added the enhancement New functionality. label Aug 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants