-
Notifications
You must be signed in to change notification settings - Fork 476
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
add property to Object causes runtime error and close connection #453
Comments
I can reproduce this. I deliberately included all enumerable properties, so that it was easier to share defaults (as explained in http://www.squaremobius.net/amqp.node/channel_api.html#args under "field table values"). But I can't think of any clever way around this problem :-/ I guess the remedy is to only use own properties when encoding, or perhaps to not include anything that comes from object .. not clever, but might work without breaking existing deployments. |
I've tracked the problem down to how the frame header is parsed. This is done by a library called bitsyntax, which uses a parser generated at build time by the now abandoned PEG.js. When a property is added to Object.prototype, I think the best path forward is migrate bitsyntax to peggy, which is actively maintained, then if the problem still persists create an issue over there. |
Gets better. The last commit to bitsyntax was to bump pegjs from 0.7.0 to 0.1.0. It was a breaking change, but the bitsyntax code was never updated, so the project is currently broken. It can be run using
So there may be some more work required before bitsyntax can be migrated to peggy. |
Migrating to Peggy is proving tricky. After updating to either pegjs@^1.0.0, peggy@^1.0.0 or peggy@latest and regenerating the parser several of the tests fail. Thankfully my original diagnosis was incorrect though and this bug can be fixed within bitsyntax without updating the parser (although I still think this should be done). I've created a PR within bitsyntax, but am not a maintainer of this library, so cannot merge or publish. (Also thanks to the peggy maintainers - they've been brilliant) |
I've republished bitsyntax under @acuminous/bitsyntax |
[email protected] now depends on https://www.npmjs.com/package/@acuminous/bitsyntax which includes the fix for this issue |
// output
obama
{ Error: read ECONNRESET
at TCP.onread (net.js:660:25)
cause:
{ Error: read ECONNRESET
at TCP.onread (net.js:660:25) errno: 'ECONNRESET', code: 'ECONNRESET', syscall: 'read' },
isOperational: true,
errno: 'ECONNRESET',
code: 'ECONNRESET',
syscall: 'read' }
// reproduce
The text was updated successfully, but these errors were encountered: