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

Remove extra initial (blank) message for streaming requests #37

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

Conversation

gabrielgrant
Copy link

Fixes #35

As mentioned in that issue, AFAICT there doesn't seem to be any reason for this code path to exist, and right now it is erroneously triggered every time, because args is an empty buffer that evaluates as "truthy"

gabrielgrant added a commit to gabrielgrant/grpc-bus-websocket-proxy-server that referenced this pull request Jun 28, 2017
@paralin
Copy link
Owner

paralin commented Jun 28, 2017

Hey, thanks for the PR.

Please squash your commits and follow the Angular Git Commit Guidelines when formatting your PR.

Upgrading typescript seems to have broken rxjs. Please make sure those dependencies are updated as well and the tests should pass.

You should be able to run npm run test and pass.

Thanks! ~Christian

Copy link
Owner

@paralin paralin left a comment

Choose a reason for hiding this comment

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

@gabrielgrant
Copy link
Author

As I mentioned in #36 , I'm currently using the older (working) protobuf v5 version of grpc-bus (v1.0), so that's what I've branched off of for this patch. Unfortunately I'm not able to tackle the full protobuf v6 upgrade at the moment, so was hoping this could be released as a 1.0.1 (I created a pre-release for our purposes here: https://github.com/gabrielgrant/grpc-bus/releases/tag/v1.0.1-dev )

Because I'm branching off the older version, though, I think that bumping the dependency versions is going to result in a conflict when trying to merge into HEAD (since those deps been updated since v1.0). Not sure what the best way to avoid that is... maybe creating a v1.0 release branch to add patch releases to?

@gabrielgrant
Copy link
Author

gabrielgrant commented Jun 29, 2017

...I'm assuming you don't want to move the commits that broke master onto a separate protobuf-v6 branch, do you? From my POV that would be the best end result (master would be in a working state again), but I understand re-writing history on master of a public repo isn't exactly considered best-practice :/

@paralin
Copy link
Owner

paralin commented Jun 29, 2017

Done, master is now pbjs 5. Please re-base your patch accordingly

@gabrielgrant
Copy link
Author

Sorry for taking forever to get back to this. Got sidetracked on some other stuff, but should be getting back to this next week (when I'll hopefully also be tackling #40 )

@paralin
Copy link
Owner

paralin commented Aug 1, 2017

No worries, I've almost completely abandoned this project myself just because I'm not actively using it right now

@gabrielgrant
Copy link
Author

gabrielgrant commented Aug 1, 2017

Yea, totally understand that it's not a priority for you, but really appreciate you keeping it up, as it still seems to be the best way to do bi-di streaming to/from a browser. We are actively using it (with a websocket client/server implementation on top), so happy to help with maintenance if you're interested.

@paralin
Copy link
Owner

paralin commented Aug 1, 2017

Nice, the fact that you're using it means it works. We should try to work on the protobufjs 6 compatibility in the coming weeks... Not sure if we have to decide on a version, or if we can make it compatible with both.

set version to 2.4.2 (latest) since version 2.1.6 doesn't build:

node_modules/@types/lodash/index.d.ts(9240,74): error TS2304: Cannot find name 'object'.
node_modules/@types/lodash/index.d.ts(13129,29): error TS2304: Cannot find name 'object'.
node_modules/@types/lodash/index.d.ts(20002,33): error TS2304: Cannot find name 'object'.
@gabrielgrant gabrielgrant force-pushed the fix-stream-request branch 2 times, most recently from 78b8b4b to 3006e76 Compare August 16, 2017 21:45
@gabrielgrant
Copy link
Author

The pushed commits should follow the style guide, and I've updated deps to fix build errors, but I'm still seeing errors with the tests:


/home/gabriel/repos/grpc-bus/src/server/server.ts[1, 18]: variable 'IGBClientMessage' used before declaration
/home/gabriel/repos/grpc-bus/src/server/server.ts[2, 16]: variable 'IGBCreateService' used before declaration
/home/gabriel/repos/grpc-bus/src/server/server.ts[4, 3]: variable 'IGBReleaseService' used before declaration
/home/gabriel/repos/grpc-bus/src/server/server.ts[5, 18]: variable 'IGBCreateCall' used before declaration
/home/gabriel/repos/grpc-bus/src/client/call.ts[2, 9]: variable 'IGBClientMessage' used before declaration
/home/gabriel/repos/grpc-bus/src/client/service.ts[10, 7]: variable 'ICallHandle' used before declaration
/home/gabriel/repos/grpc-bus/src/client/client.ts[2, 9]: variable 'IGBClientMessage' used before declaration

It's not clear to me what these particular variables/declarations have in common/are doing differently from other similar lines in the same files. Any idea what the issue(s) could be there?

@paralin
Copy link
Owner

paralin commented Aug 16, 2017

Let me take a look

@gabrielgrant
Copy link
Author

gabrielgrant commented Aug 16, 2017

Cool, thanks a lot. I'm happy to actually make the fixes, but I don't have much of an idea of where to start debugging, and doing some digging on Google didn't really give me any clues.

And again, to be clear: these problems only crop up when running the npm run test -- npm run build completes successfully, and creates a working package (at least it seems to be fully working -- we're using it :P)

Copy link
Owner

@paralin paralin left a comment

Choose a reason for hiding this comment

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

Just a few minor things:

  • Try to avoid capital letters and () in your commit message as per the general Angular commit style
  • When doable include a category: fix(package): pin typescript to fix lodash build error
  • fix(package): bump rjxs to 5.4.2 to fix ts2.4 build error

@@ -24,7 +24,7 @@
},
"dependencies": {
"lodash": "^4.0.0",
"rxjs": "5.0.0-rc.5"
"rxjs": "5.4.2"
Copy link
Owner

Choose a reason for hiding this comment

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

Can we pin this to something a bit more liberal, like rxjs at ~5.4.0?

Copy link
Author

Choose a reason for hiding this comment

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

The specific fix needed was in 5.4.2, so ~5.4.0 won't do, but I believe ~5.4.2 should work. I'll make the change.

Copy link
Owner

Choose a reason for hiding this comment

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

OK, this change is good. ~5.4.2, that is.

@@ -41,7 +41,7 @@
"protobufjs": "^5.0.0",
"ts-node": "^1.7.0",
"tslint": "^4.0.0",
"typescript": "^2.1.0"
"typescript": "2.4.2"
Copy link
Owner

Choose a reason for hiding this comment

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

Again here, I'd prefer ^2.4.0 to 2.4.2 speciically

Copy link
Owner

Choose a reason for hiding this comment

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

Although this is a compiler question so it's not actually that critical to do this, I suppose

Copy link
Author

Choose a reason for hiding this comment

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

Again, I believe there was a breaking change specifically between 2.4.0 and 2.4.1, so I don't think ^2.4.0 is a good idea, but ~2.4.2 should work. That being said, the fact that they introduced a breaking change in a patch release seems like perhaps a good reason to not trust that future patch releases will be problem-free, and given this is the compiler, I'd be a bit more inclined to leave this pegged exactly than with RXJS. I don't have super-strong feelings either way, though. What do you prefer?

Copy link
Owner

Choose a reason for hiding this comment

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

If you want to keep it pegged that's fine. I see what you're saying about the breaking changes

Copy link
Owner

@paralin paralin left a comment

Choose a reason for hiding this comment

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

Please also add a commit body to your commits, where you explain what you did briefly. You can end the message with a line that says something like

Fixes #37

But in this case you will want to be sure your commit messages have at least as much info as your PR messages, because the commit message is what lasts.

@paralin
Copy link
Owner

paralin commented Aug 18, 2017

Npm will shrinkwrap the packages to lock them to a specific version. Then greenkeeper goes and sends a notification when they are updated but still within the range.

@paralin
Copy link
Owner

paralin commented Sep 19, 2017

hey, apologies for not getting around to this for so long. I will keep an eye out for PRs / messages on this repo this week, and try to get it all merged and sorted for you. currently waiting for a revision of this PR, though.

@gabrielgrant
Copy link
Author

Hey, no worries at all, and sorry I haven't gotten back to this -- we've been super busy getting ready for a release that should be happening tomorrow (fingers crossed!). In prep for that, we've made a few more updates on my release branch -- specifically, added support for GRPC metadata. Hopefully should have time to clean this all up and get it all properly PRed for you to merge into your master in the next week.

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

Successfully merging this pull request may close these issues.

None yet

2 participants