Skip to content

Commit c982795

Browse files
committed
api: Use RawParameter when passing queue_id and local_id
This endpoint in particular expects queue_id and local_id each to be a String just passed as itself, not JSON-encoded.
1 parent e9eabdc commit c982795

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/api/route/messages.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@ Future<SendMessageResult> sendMessage(
193193
'to': destination.userIds,
194194
}}),
195195
'content': RawParameter(content),
196-
if (queueId != null) 'queue_id': queueId, // TODO should this use RawParameter?
197-
if (localId != null) 'local_id': localId, // TODO should this use RawParameter?
196+
if (queueId != null) 'queue_id': RawParameter(queueId),
197+
if (localId != null) 'local_id': RawParameter(localId),
198198
if (readBySender != null) 'read_by_sender': readBySender,
199199
},
200200
overrideUserAgent: switch ((supportsReadBySender, readBySender)) {

test/api/route/messages_test.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,8 @@ void main() {
362362
'to': streamId.toString(),
363363
'topic': topic,
364364
'content': content,
365-
'queue_id': '"abc:123"',
366-
'local_id': '"456"',
365+
'queue_id': 'abc:123',
366+
'local_id': '456',
367367
'read_by_sender': 'true',
368368
});
369369
});

0 commit comments

Comments
 (0)