Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/common/lib/client/restannotations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ class RestAnnotations {
headers = Defaults.defaultPostHeaders(client.options, { format }),
params = {};

Utils.mixin(headers, client.options.headers);

const requestBody = Utils.encodeBody([wireAnnotation], client._MsgPack, format);

await Resource.post(
Expand Down
9 changes: 8 additions & 1 deletion test/browser/modular.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,10 @@ function registerAblyModularTests(Helper) {
it('doesn’t break when it receives an ANNOTATION ProtocolMessage', async function () {
const helper = this.test.helper;
const rxClient = new BaseRealtime(
helper.ablyClientOptions({ plugins: { WebSocketTransport, FetchRequest } }),
helper.ablyClientOptions({
clientId: Helper.randomString(10),
plugins: { WebSocketTransport, FetchRequest },
}),
);
const channelName = 'mutable:annotation-1';

Expand All @@ -902,6 +905,7 @@ function registerAblyModularTests(Helper) {

const txClient = new BaseRealtime(
this.test.helper.ablyClientOptions({
clientId: Helper.randomString(10),
plugins: {
WebSocketTransport,
FetchRequest,
Expand Down Expand Up @@ -935,6 +939,7 @@ function registerAblyModularTests(Helper) {
const channelName = 'mutable:annotation-2';
const rxClient = new BaseRealtime(
helper.ablyClientOptions({
clientId: Helper.randomString(10),
plugins: {
WebSocketTransport,
FetchRequest,
Expand All @@ -949,6 +954,7 @@ function registerAblyModularTests(Helper) {
await helper.monitorConnectionThenCloseAndFinishAsync(async () => {
const txRealtime = new BaseRealtime(
this.test.helper.ablyClientOptions({
clientId: Helper.randomString(10),
plugins: {
WebSocketTransport,
FetchRequest,
Expand All @@ -958,6 +964,7 @@ function registerAblyModularTests(Helper) {
);
const txRest = new BaseRest(
this.test.helper.ablyClientOptions({
clientId: Helper.randomString(10),
plugins: {
FetchRequest,
Annotations,
Expand Down
4 changes: 2 additions & 2 deletions test/realtime/annotations.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ define(['shared_helper', 'chai'], function (Helper, chai) {
done(err);
return;
}
rest = helper.AblyRest();
rest = helper.AblyRest({ clientId: Helper.randomString(10) });
done();
});
});

beforeEach(async () => {
realtime = helper.AblyRealtime();
realtime = helper.AblyRealtime({ clientId: Helper.randomString(10) });
});

afterEach(async () => {
Expand Down
Loading