Skip to content

Erroneous Property / Structure for Channel Events #1585

@robmoffat

Description

@robmoffat

Minor Issue

Please use minor issues for discrepancies or errors found in the spec or supporting documentation, examples, and other materials. If you wish to propose a new feature or a revision to an existing feature, please use the Enhancement Request template.

Area of Issue

  • App Directory
  • API
  • Context Data
  • Intents
  • Desktop Agent Bridging
  • Use Cases
  • Other

This is a bit confusing:

// Events.ts

/**
 * Type defining the format of event `userChannelChanged` objects
 */
export interface FDC3ChannelChangedEvent extends FDC3Event {
  readonly type: 'userChannelChanged';
  readonly details: {
    currentChannelId: string | null;
  };
}
// BrowserTypes.ts

export interface ChannelChangedEvent {
  /**
   * Metadata for messages sent by a Desktop Agent to an app notifying it of an event.
   */
  meta: BroadcastEventMeta;
  /**
   * The message payload contains details of the event that the app is being notified about.
   */
  payload: ChannelChangedEventPayload;
  /**
   * Identifies the type of the message and it is typically set to the FDC3 function name that
   * the message relates to, e.g. 'findIntent', with 'Response' appended.
   */
  type: 'channelChangedEvent';
}

/**
 * The message payload contains details of the event that the app is being notified about.
 */
export interface ChannelChangedEventPayload {
  /**
   * The Id of the channel that the app was added to or `null` if it was removed from a
   * channel.
   */
  newChannelId: null | string;
}

the problem is that one is taking a newChannelId and the other is currentChannelId.
... and the event type changes too

ok, this is a weird issue, definitely an error:

/**
 * Type defining the format of event objects that may be received
 * via the FDC3 API's `addEventListener` function.
 */
export interface FDC3Event extends ApiEvent {
  readonly string: FDC3EventTypes;
  readonly details: any;
}

/**
 * Type defining the format of event `userChannelChanged` objects
 */
export interface FDC3ChannelChangedEvent extends FDC3Event {
  readonly type: 'userChannelChanged';
  readonly details: {
    currentChannelId: string | null;
  };
}

There's a property called "string" on the FDC3Event!

3:01
I'll raise an issue

Message Kris West

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions