Skip to content

Adding a warning for mismatched COGS and cogs-client versions#54

Merged
iambalaam merged 1 commit into
mainfrom
legacy-media-event-warning
May 12, 2026
Merged

Adding a warning for mismatched COGS and cogs-client versions#54
iambalaam merged 1 commit into
mainfrom
legacy-media-event-warning

Conversation

@iambalaam
Copy link
Copy Markdown
Contributor

@iambalaam iambalaam commented May 11, 2026

  • Adds a warning when a COGS instance that doesn't support stateless media sends legacy media events to a new cogs-sdk.

Tested Using cogs-sdk on main and current COGS in production 5.9

Action
Screenshot 2026-05-11 at 14 28 40
Leads to console warning
Screenshot 2026-05-11 at 14 29 01
(now says cogs-client not cogs-client-react)

@iambalaam iambalaam requested a review from tomdixon May 11, 2026 13:34
// From cogs-client@3.0.0 legacy media events are no longer supported.
// COGS will continue sending them with an added 'media_strategy' field for backwards compatibility.
// If media_strategy is not present, the user is attempting to use a new cogs-client with an old COGS.
case 'audio_play':
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could this not just be the default handler rather than specifying the message types here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Currently there are also these that don't need any warning

                case 'show_reset':
                case 'text_hints_update':
                case 'cogs_environment':
                case 'media_state':

And I'm assuming that in future it'll be a pain to add a new message, then have to remember that you have to opt-out of a warning

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes good point!

@iambalaam iambalaam merged commit 79fa6cc into main May 12, 2026
5 checks passed
@iambalaam iambalaam deleted the legacy-media-event-warning branch May 12, 2026 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants