From 873c4a74b9d42d1ca332db19eaba8154251fbf5f Mon Sep 17 00:00:00 2001 From: Muzzammil Shahid Date: Tue, 14 May 2024 21:11:20 +0500 Subject: [PATCH 1/2] Handle progress yield and invocation --- lib/src/session.dart | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/src/session.dart b/lib/src/session.dart index df0ff9f..eff19d9 100644 --- a/lib/src/session.dart +++ b/lib/src/session.dart @@ -1,5 +1,6 @@ import "package:wampproto/messages.dart"; import "package:wampproto/serializers.dart"; +import "package:wampproto/src/dealer.dart"; import "package:wampproto/src/exception.dart"; class WAMPSession { @@ -37,7 +38,10 @@ class WAMPSession { if (!_invocationRequests.containsKey(msg.requestID)) { throw ArgumentError("cannot yield for unknown invocation request"); } - _invocationRequests.remove(msg.requestID); + bool progress = msg.options[optionProgress] ?? false; + if (!progress) { + _invocationRequests.remove(msg.requestID); + } return _serializer.serialize(msg); } else if (msg is Publish) { @@ -78,8 +82,10 @@ class WAMPSession { if (!_callRequests.containsKey(msg.requestID)) { throw ProtocolError("received RESULT for invalid request ID ${msg.requestID}"); } - _callRequests.remove(msg.requestID); - + bool progress = msg.details["progress"] ?? false; + if (!progress) { + _callRequests.remove(msg.requestID); + } return msg; } else if (msg is Registered) { if (!_registerRequests.containsKey(msg.requestID)) { From 636026f61af17800f62495ade82f5b6137c9b854 Mon Sep 17 00:00:00 2001 From: Muzzammil Shahid Date: Thu, 5 Sep 2024 18:13:31 +0500 Subject: [PATCH 2/2] Add callee features --- lib/src/joiner.dart | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/src/joiner.dart b/lib/src/joiner.dart index f8f0a70..649119c 100644 --- a/lib/src/joiner.dart +++ b/lib/src/joiner.dart @@ -6,7 +6,12 @@ import "package:wampproto/src/types.dart"; final clientRoles = >{ "caller": {"features": {}}, - "callee": {"features": {}}, + "callee": { + "features": { + "progressive_call_results": true, + "call_canceling": true, + }, + }, "publisher": {"features": {}}, "subscriber": {"features": {}}, };