Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/modules/StreamingClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -502,8 +502,10 @@ export class StreamingClient {
const sessionId = signalMessage.sessionId as string;
this.publicEventEmitter.emit(AnamEvent.SESSION_READY, sessionId);
break;
case SignalMessageAction.HEARTBEAT:
break;
default:
console.error(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why change the level? If we do something similar in the future, the warning might be ignored, which we might not want?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes more sense as a warning rather than error as it's not "breaking", i.e. it's not something that stops the app functioning and shouldn't ever be. In that case we'll do a major version bump :)

It'll still log to console all the same, just at a lower level.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think error was always the wrong choice here, as this can get triggered by any future extensions to the signal message options which is likely and anyone not on the latest version from the point of release will get hit with errors, when from their point of view nothing has gone wrong. We have to make the changes backwards compatible anyway to prevent breaking existing clients so a warning to upgrade felt more appropriate than an explicit error. If I was using a package and that package starting throwing errors even though I hadn't changed anything and everything appeared to still be functioning I would probably consider it bad DX.

console.warn(
'StreamingClient - onSignalMessage: unknown signal message action type. Is your anam-sdk version up to date?',
signalMessage,
);
Expand Down
Loading