Coder Social home page Coder Social logo

Comments (4)

konsultaner avatar konsultaner commented on September 22, 2024

Hi, great that you like the lib. If your router doesn't send a PUBLISHED message back to the client. Your await will block forever. Could you check your router wether it returns a PUBLISHED or not? If it does return a PUBLISHED this is a bug.

from connectanum-dart.

konsultaner avatar konsultaner commented on September 22, 2024

These are the lines of code:

Future<Published> publish(String topic,
{List<dynamic>? arguments,
Map<String, dynamic>? argumentsKeywords,
PublishOptions? options}) {
var publish = Publish(nextPublishId++, topic,
arguments: arguments,
argumentsKeywords: argumentsKeywords,
options: options);
_transport.send(publish);
var publishStream = _openSessionStreamController.stream.where((message) {
if (message is Published &&
message.publishRequestId == publish.requestId) {
return true;
}
if (message is Error &&
message.requestTypeId == MessageTypes.CODE_PUBLISH &&
message.requestId == publish.requestId) {
throw message;
}
return false;
}).cast<Published>();
return publishStream.first;
}

from connectanum-dart.

aarlt avatar aarlt commented on September 22, 2024

Hi, great that you like the lib. If your router doesn't send a PUBLISHED message back to the client. Your await will block forever. Could you check your router wether it returns a PUBLISHED or not? If it does return a PUBLISHED this is a bug.

Thanks a lot for answering so fast!

I did a bit debugging and it looks indeed like that my router is currently not sending the PUBLISHED message. The router is only creating an EVENT message, but PUBLISHED is missing.

2022-02-03T14:39:51-0500 [Router      10810 crossbar.router.protocol.WampWebSocketServerProtocol] WAMP RECV: message=Publish(request=1, topic=3b6a27bcceb6a42d62a3a8d02a6f0d73653215771de243a63ac048a18b59da29.push, args=['WHello'], kwargs=None, acknowledge=None, exclude_me=None, exclude=None, exclude_authid=None, exclude_authrole=None, eligible=None, eligible_authid=None, eligible_authrole=None, retain=None, enc_algo=None, enc_key=None, enc_serializer=None, payload=-, forward_for=None), session=7557342860847853, authid=3b6a27bcceb6a42d62a3a8d02a6f0d73653215771de243a63ac048a18b59da29

2022-02-03T14:39:51-0500 [Router      10810 crossbar.router.router.Router] Validate 'event' for '3b6a27bcceb6a42d62a3a8d02a6f0d73653215771de243a63ac048a18b59da29.push'

2022-02-03T14:39:51-0500 [Router      10810 crossbar.router.role.RouterRole] CrossbarRouterRoleStaticAuth.authorize identity 3b6a27bcceb6a42d62a3a8d02a6f0d73653215771de243a63ac048a18b59da29.push publish

2022-02-03T14:39:51-0500 [Router      10810 crossbar.router.router.Router] Authorized action 'publish' for URI '3b6a27bcceb6a42d62a3a8d02a6f0d73653215771de243a63ac048a18b59da29.push' by session 7557342860847853 with authid '3b6a27bcceb6a42d62a3a8d02a6f0d73653215771de243a63ac048a18b59da29' and authrole 'identity' -> authorization: {'allow': True, 'disclose': False, 'cache': True}

2022-02-03T14:39:51-0500 [Router      10810 crossbar.router.broker.Broker] <crossbar.router.broker.Broker.processPublish>::on_authorize_success() - permission GRANTED for PUBLISH to topic "3b6a27bcceb6a42d62a3a8d02a6f0d73653215771de243a63ac048a18b59da29.push" [realm="test", session_id=7557342860847853, authid="3b6a27bcceb6a42d62a3a8d02a6f0d73653215771de243a63ac048a18b59da29", authrole="identity"]

2022-02-03T14:39:51-0500 [Router      10810 crossbar.router.broker.Broker] dispatching for subscription=ExactUriObservation(id=2741518893347922, uri=3b6a27bcceb6a42d62a3a8d02a6f0d73653215771de243a63ac048a18b59da29.push, match=exact, ordered=False, extra=<crossbar.router.broker.SubscriptionExtra object at 0x1187afbb0>, created=2022-02-03T19:39:51.302Z, observers={<crossbar.router.session.RouterSession object at 0x1187238e0>}), storing_event=False

2022-02-03T14:39:51-0500 [Router      10810 crossbar.router.broker.Broker] unchunked dispatching to 1 receivers

2022-02-03T14:39:51-0500 [Router      10810 crossbar.router.protocol.WampWebSocketServerProtocol] WAMP SEND: message=Event(subscription=2741518893347922, publication=8264063572469899, args=['Hello'], kwargs=None, publisher=None, publisher_authid=None, publisher_authrole=None, topic=None, retained=None, enc_algo=None, enc_key=None, enc_serializer=None, payload=-, forward_for=None), session=3677469751106487, authid=3b6a27bcceb6a42d62a3a8d02a6f0d73653215771de243a63ac048a18b59da29

I use crossbar.io v21.3.1 as a router. Right now I don't do anything fancy yet. I just added a dynamic authenticator.

If I read the spec correctly, a broker need to send PUBLISHED to the publisher to acknowledge publication, but this message seem to be not generated. And the EVENT message seem to be the mechanism to inform the subscribers. So I guess your implementation is correct.

Not sure what to do now. I guess I need to check the router implementation. If you have any idea what could be the reason for this behaviour, let me know :)

from connectanum-dart.

aarlt avatar aarlt commented on September 22, 2024

This issue seem to be related to a missing PUBLISHED message. My router implementation is not generating that needed message. Closing.

from connectanum-dart.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.