From 2d5323d0347ee4c1243792f3b69543ca7d43205a Mon Sep 17 00:00:00 2001 From: Simon Woolf Date: Thu, 7 Nov 2024 14:13:43 -0500 Subject: [PATCH] Linter fixes --- ably.d.ts | 1 - src/common/lib/client/realtimepresence.ts | 9 +++++++-- test/realtime/presence.test.js | 8 ++++---- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/ably.d.ts b/ably.d.ts index f9e59b1d9..cbe1df3dd 100644 --- a/ably.d.ts +++ b/ably.d.ts @@ -2284,7 +2284,6 @@ export declare interface Channels { * 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. diff --git a/src/common/lib/client/realtimepresence.ts b/src/common/lib/client/realtimepresence.ts index 3a1fc62ed..dc4520da6 100644 --- a/src/common/lib/client/realtimepresence.ts +++ b/src/common/lib/client/realtimepresence.ts @@ -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); }); diff --git a/test/realtime/presence.test.js b/test/realtime/presence.test.js index f4ee91c12..2a7672e2b 100644 --- a/test/realtime/presence.test.js +++ b/test/realtime/presence.test.js @@ -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; @@ -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'); @@ -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');