Skip to content

Commit

Permalink
Linter fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonWoolf committed Nov 7, 2024
1 parent d9a6f4b commit 2d5323d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
1 change: 0 additions & 1 deletion ably.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2284,7 +2284,6 @@ export declare interface Channels<T> {
* This experimental method allows you to create custom realtime data feeds by selectively subscribing
* to receive only part of the data from the channel.
* See the [announcement post](https://pages.ably.com/subscription-filters-preview) for more information.
*
* @param name - The channel name.
* @param deriveOptions - A {@link DeriveOptions} object.
* @param channelOptions - A {@link ChannelOptions} object.
Expand Down
9 changes: 7 additions & 2 deletions src/common/lib/client/realtimepresence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -439,10 +439,15 @@ class RealtimePresence extends EventEmitter {
// RTP17g: Send ENTER containing the member id, clientId and data
// attributes.
// RTP17g1: suppress id if the connId has changed
const id = (entry.connectionId === connId) ? entry.id : undefined;
const id = entry.connectionId === connId ? entry.id : undefined;
this._enterOrUpdateClient(id, entry.clientId, entry.data, 'enter').catch((err) => {
const wrappedErr = new ErrorInfo('Presence auto re-enter failed', 91004, 400, err);
Logger.logAction(this.logger, Logger.LOG_ERROR, 'RealtimePresence._ensureMyMembersPresent()', 'Presence auto re-enter failed; reason = ' + Utils.inspectError(err));
Logger.logAction(
this.logger,
Logger.LOG_ERROR,
'RealtimePresence._ensureMyMembersPresent()',
'Presence auto re-enter failed; reason = ' + Utils.inspectError(err),
);
const change = new ChannelStateChange(this.channel.state, this.channel.state, true, false, wrappedErr);
this.channel.emit('update', change);
});
Expand Down
8 changes: 4 additions & 4 deletions test/realtime/presence.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

define(['ably', 'shared_helper', 'async', 'chai'], function (Ably, Helper, async, chai) {
const { expect, assert } = chai;
const { expect, assert } = chai;
var createPM = Ably.protocolMessageFromDeserialized;
var PresenceMessage = Ably.Realtime.PresenceMessage;

Expand Down Expand Up @@ -1636,7 +1636,7 @@ define(['ably', 'shared_helper', 'async', 'chai'], function (Ably, Helper, async
await realtime.connection.once('connected');
await channel.attach();
// presence.get will wait for a sync if needed
await channel.presence.get()
await channel.presence.get();

const pOnPresence = channel.presence.subscriptions.once('enter');
await channel.presence.enterClient('one', 'onedata');
Expand Down Expand Up @@ -1711,14 +1711,14 @@ define(['ably', 'shared_helper', 'async', 'chai'], function (Ably, Helper, async
it('presence_auto_reenter_different_connid', async function () {
const helper = this.test.helper;
const channelName = 'presence_auto_reenter_different_connid';
const realtime = helper.AblyRealtime({transportParams: {remainPresentFor: 5000}});
const realtime = helper.AblyRealtime({ transportParams: { remainPresentFor: 5000 } });
const channel = realtime.channels.get(channelName);

await realtime.connection.once('connected');
const firstConnId = realtime.connection.id;
await channel.attach();
// presence.get will wait for a sync if needed
await channel.presence.get()
await channel.presence.get();

const pOnPresence = channel.presence.subscriptions.once('enter');
await channel.presence.enterClient('one', 'onedata');
Expand Down

0 comments on commit 2d5323d

Please sign in to comment.