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
giovanni-bertoncelli opened this issue Jan 24, 2022 · 5 comments
Open

Action addRoute tries to serialize function #294

giovanni-bertoncelli opened this issue Jan 24, 2022 · 5 comments

Comments

@giovanni-bertoncelli
Copy link
Contributor

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

@giovanni-bertoncelli
Copy link
Contributor Author

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

@giovanni-bertoncelli
Copy link
Contributor Author

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

3 participants