Skip to content

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

Open
Frank3K wants to merge 1 commit into
google:masterfrom
Frank3K:fix/glitch-mode-error-message
Open

Frank3K wants to merge 1 commit 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).

A stray unary plus turned the appended hint into NaN, so an invalid
glitch-effect mode logged "…NaN" instead of "mode defaulting to
'sporadic'".

This branch has not been deployed

No deployments
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.

1 participant