Skip to content

Unwrapping single result #433

Description

@KSDaemon

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions