Fix runtime crashes from non-array API responses, 405 on play endpoint, and WGSL reserved keyword#515
Draft
Fix runtime crashes from non-array API responses, 405 on play endpoint, and WGSL reserved keyword#515
Conversation
…rd, shader defaults Agent-Logs-Url: https://github.com/ford442/image_video_effects/sessions/b24f2e6d-e33e-4463-a3be-6bda3837495d Co-authored-by: ford442 <9397845+ford442@users.noreply.github.com>
Agent-Logs-Url: https://github.com/ford442/image_video_effects/sessions/b24f2e6d-e33e-4463-a3be-6bda3837495d Co-authored-by: ford442 <9397845+ford442@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix persistent runtime errors after merged PR #514
Fix runtime crashes from non-array API responses, 405 on play endpoint, and WGSL reserved keyword
Apr 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Several runtime errors introduced or left unaddressed after PR #514 cause app crashes and broken shader rendering. This PR fixes them with targeted, defensive changes.
API response type guards
API endpoints occasionally return non-array payloads (wrapped objects, error responses, etc.). Calling
.map()or.filter()directly on these crashes the app instead of falling back gracefully.Added
Array.isArray()guards that throw a descriptiveTypeErrorwhen the response isn't an array, letting existingcatchblocks trigger the local fallbacks:405 on play tracking endpoint
The play-count fetch was sending
POSTbut the server only acceptsGET:WGSL reserved keyword in
gen-crystalline-chrono-dysonmodis a reserved keyword in WGSL, causing aGPUValidationErrorat shader compilation and cascading[Invalid CommandBuffer]failures. Renamed the custom helper tofmod.Missing shader defaults
Added
SHADER_DEFAULTSentries fordigital-hazeandgen-crystalline-chrono-dyson(tuned to the shaders' param semantics: Panel Density, Quasar Glow, Flux Speed, Swarm Count) so they don't silently fall back to generic0.5values.Original prompt
This pull request was created from Copilot chat.