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

Action addRoute tries to serialize function #294

Open
ghost opened this issue Jan 24, 2022 · 5 comments
Open

Action addRoute tries to serialize function #294

ghost opened this issue Jan 24, 2022 · 5 comments

Comments

@ghost
Copy link

ghost commented Jan 24, 2022

I'm using the new gateway action addRoute and it seems to try to serialize a function, which is not a problem with JSON serializer, but with CBOR for example crashes the entire node.
image
image

@ghost
Copy link
Author

ghost commented Jan 24, 2022

I think the issue is here: https://github.com/moleculerjs/moleculer-web/blob/master/src/index.js#L1177 where the entire route is returned with functions included...

@AndreMaz
Copy link
Member

Hi @giovanni-bertoncelli can you please create a repro repo?

@icebob
Copy link
Member

icebob commented Jan 25, 2022

We can't fix it. Related open issue in cbor repo: kriszyp/cbor-x#2

@ghost
Copy link
Author

ghost commented Feb 14, 2022

We have software in production that has migrated to the CBOR serializer... this bug can be very frustrating, can't this be fixed on the moleculer side or with a PR on cbor-x?

@icebob
Copy link
Member

icebob commented Feb 19, 2022

Alternative, if you copy the CBOR serializer code and walk the payload in serialize method and remove functions. It beats the performance pretty well, this is why I don't do that in the built-in serializer. The eventual solution if it's fixed in CBOR lib.

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