Skip to content

Commit

Permalink
Merge pull request #60 from muzzammilshahid/fix-publish-request
Browse files Browse the repository at this point in the history
Fix: Save publish request only if acknowledgment is true
  • Loading branch information
muzzammilshahid authored Oct 16, 2024
2 parents 9db87f9 + 261f86c commit 64ca6f4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions lib/src/session.dart
Original file line number Diff line number Diff line change
Expand Up @@ -208,12 +208,13 @@ class Session {
}) {
var publish = msg.Publish(_nextID, topic, args: args, kwargs: kwargs, options: options);

var completer = Completer<void>();
_publishRequests[publish.requestID] = completer;
_baseSession.send(_wampSession.sendMessage(publish));

var ack = options?["acknowledge"] ?? false;
if (ack) {
var completer = Completer<void>();
_publishRequests[publish.requestID] = completer;

return completer.future;
}

Expand Down

0 comments on commit 64ca6f4

Please sign in to comment.