Skip to content

fix(effects): show the glitch mode fallback hint in the error message - #5221

Merged
diegoteran merged 3 commits into
google:masterfrom
Frank3K:fix/glitch-mode-error-message
Dec 1, 2026
Merged

diegoteran merged 3 commits into
google:masterfrom
Frank3K:fix/glitch-mode-error-message

Conversation

@Frank3K

@Frank3K Frank3K commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Reference Issue

None.

Summary

When <glitch-effect> gets an invalid mode, it logs a validation error and falls back to sporadic. The hint about the fallback was never shown: a stray unary plus (message + +'\nmode defaulting…') turned it into NaN, so the console showed:

Validation Error: invalid is not a valid value. Expected sporadic | constantNaN

With the fix it shows:

Validation Error: invalid is not a valid value. Expected sporadic | constant
mode defaulting to 'sporadic'

Testing

Added glitch-spec.ts with a test that sets an invalid mode and checks the logged message. It fails without the fix and passes with it (Chromium, via web-test-runner).

Frank3K and others added 3 commits November 13, 2026 23:25
A stray unary plus turned the appended hint into NaN, so an invalid
glitch-effect mode logged "…NaN" instead of "mode defaulting to
'sporadic'".

@diegoteran diegoteran left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks!

@diegoteran
diegoteran merged commit 13c3c98 into google:master Dec 1, 2026
8 checks passed
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