diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 2794721..a0d07b6 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -17,7 +17,7 @@ jobs: - name: Set up Dart uses: dart-lang/setup-dart@v1 with: - sdk: 3.3.0 + sdk: 3.4.0 - name: Install dependencies run: make install diff --git a/lib/src/session.dart b/lib/src/session.dart index a771eaa..7364976 100644 --- a/lib/src/session.dart +++ b/lib/src/session.dart @@ -208,12 +208,13 @@ class Session { }) { var publish = msg.Publish(_nextID, topic, args: args, kwargs: kwargs, options: options); - var completer = Completer(); - _publishRequests[publish.requestID] = completer; _baseSession.send(_wampSession.sendMessage(publish)); var ack = options?["acknowledge"] ?? false; if (ack) { + var completer = Completer(); + _publishRequests[publish.requestID] = completer; + return completer.future; }