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

Use outputVar instead of hard coding this.output in JS codegen #2950

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ben-harris-5
Copy link

When generating the JS Thrift clients, it hard-codes this.output in a few places; however, if gen_node_ is true, our variable should be output instead. We set a variable, outputVar, up on line 1968/1970 of the file, but don't use it everywhere. In NodeJS environment, this can lead to the wrong flush being called, which can lead to issues; for example, with the header transport protocol, the headers can either go missing or be sent incorrectly.

I believe this is a trivial change not requiring a ticket.

  • Did you create an Apache Jira ticket? (Request account here, not required for trivial changes)
  • If a ticket exists: Does your pull request title follow the pattern "THRIFT-NNNN: describe my issue"?
  • Did you squash your changes to a single commit? (not required, but preferred)
  • Did you do your best to avoid breaking changes? If one was needed, did you label the Jira ticket with "Breaking-Change"?
  • If your change does not involve any code, include [skip ci] anywhere in the commit message to free up build resources.

@ben-harris-5
Copy link
Author

ben-harris-5 commented Mar 22, 2024

CI is failing for this, but I'm incredibly unsure why or what's going wrong here. I'd greatly appreciate any assistance that folks could provide on this!

EDIT: Yeah, Java's failing, but this doesn't touch the Java code o_o

@ben-harris-5 ben-harris-5 marked this pull request as ready for review March 22, 2024 18:48
@Jens-G Jens-G added javascript Pull requests that update Javascript code nodejs labels Mar 22, 2024
@fishy
Copy link
Member

fishy commented Apr 24, 2024

Please:

  1. Create a JIRA ticket to describe the issue (with what's the current generated code and what should be the correct code)
  2. Resolve the merge conflicts (java failing should be fixed on latest master version)
  3. Create an unit test under lib/nodejs/test/ (or maybe lib/js/test/?) to verify this fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
javascript Pull requests that update Javascript code nodejs
Projects
None yet
3 participants