diff --git a/src/lib/adapter.ts b/src/lib/adapter.ts index 954ecf326..3d85f333c 100644 --- a/src/lib/adapter.ts +++ b/src/lib/adapter.ts @@ -230,11 +230,11 @@ class GleeAdapter extends EventEmitter { getSubscribedChannels(): string[] { return this._channelNames.filter((channelName) => { const channel = this._parsedAsyncAPI.channels().get(channelName) - if (channel.operations().filterByReceive().length <= 0) return false + if (channel.operations().filterBySend().length == 0) return true const channelServers = channel.servers() ? channel.servers() - : channel.extensions().get('x-servers').value() || this._parsedAsyncAPI.channels().map(e => e.address) + : channel.extensions().get('x-servers')?.value() || this._parsedAsyncAPI.allServers() return channelServers.includes(this._serverName) }) } diff --git a/test/lib/adapter.test.ts b/test/lib/adapter.test.ts index ef6c612e5..8942ea4f6 100644 --- a/test/lib/adapter.test.ts +++ b/test/lib/adapter.test.ts @@ -151,7 +151,7 @@ describe('adapter', () => { TEST_ASYNCAPI_DOCUMENT ) expect(adapter.channelNames).toStrictEqual( - TEST_ASYNCAPI_DOCUMENT.channels().all().map(e =>e.address) + TEST_ASYNCAPI_DOCUMENT.channels().all().map(e =>e.address()) ) }) })