Skip to content

ably logs subscribe misses events — subscribes to wrong event names on [meta]log #411

Description

@mclark-ably

Bug

ably logs subscribe produces no output even when events are actively being published to [meta]log.

Root cause

In src/commands/logs/subscribe.ts, the command subscribes to [meta]log

const logsChannelName = `[meta]log`;

using named events:

const logTypes = flags.type
  ? [flags.type]
  : [
      "channel.lifecycle",
      "channel.occupancy",
      "channel.presence",
      "connection.lifecycle",
      "push.publish",
    ];

for (const logType of logTypes) {
  channel.subscribe(logType, callback);
}

However, messages on [meta]log do not have event names like channel.lifecycle, connection.lifecycle, etc.

As a result, none of the named subscriptions ever match, and no events are received.

Steps to reproduce

Run both commands simultaneously while webhook/integration issues are occurring on the app:

# Receives events correctly
ably channels subscribe "[meta]log"

# Receives nothing
ably logs subscribe

Expected behaviour

ably logs subscribe should receive all events published to [meta]log.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions