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

Unwrapping single result #433

Open
KSDaemon opened this issue May 9, 2024 · 0 comments
Open

Unwrapping single result #433

KSDaemon opened this issue May 9, 2024 · 0 comments
Labels
feature New feature request

Comments

@KSDaemon
Copy link
Owner

KSDaemon commented May 9, 2024

Those familiar with Autobahn family WAMP clients — know that all Autobahn clients are unwrapping the single positional argument when returning the result to the client code. This means that whenever you receive from the wire WAMP messages like this: [50, 7814135, {}, ["Hello, world!"]] (it is a RESULT message), the client-side code will get the single string "Hello, world!" as the result instead of array ["Hello, world!"]. This happens automatically whenever the payload consists only of a positional argument with one item (the type and structure of the item don't matter).

While this behavior may be convenient when you work only inside Autobahn family stack, it leads to some complications when you have other WAMP clients running, because developers got confused about why in one case remote procedure returns "Hello, world!" and ["Hello, world!"] in other.

So it would be pretty neat to have a compatibility flag explicitly set to ON to unwrap such single results.

This flag may be set on the instance level or granularly for a specific CALL/SUBSCRIBE.

@KSDaemon KSDaemon added the feature New feature request label May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature request
Projects
None yet
Development

No branches or pull requests

1 participant