Skip to content

fix(web): guard malformed source title fields - #860

Merged
ProdigyV21 merged 4 commits into
ProdigyV21:mainfrom
petomalik6-duda:fix/web-source-nonstring-fields
Nov 6, 2026
Merged

ProdigyV21 merged 4 commits into
ProdigyV21:mainfrom
petomalik6-duda:fix/web-source-nonstring-fields

Conversation

@petomalik6-duda

Copy link
Copy Markdown
Contributor

Fixes #856.

Summary

ARVIO Web could crash the entire Details/Sources screen when a provider returned runtime values that did not match the TypeScript declaration, e.g. a non-string behaviorHints.filename or description.

The observed crash was:

TypeError: t.trim is not a function

This PR:

  • guards behaviorHints.filename before calling .trim()
  • ignores non-string description values instead of calling .split() on them
  • adds safe fallbacks for malformed source / addonName
  • adds regression tests covering number/object/array runtime payloads and preserving valid labels

The change is intentionally small and limited to source-title presentation hardening so one malformed source cannot take down the whole Sources screen.

@github-actions github-actions Bot added the area: web Changes to web or Netlify sites label Nov 2, 2026

@petomalik6-duda petomalik6-duda left a comment

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.

Patch is limited to runtime type guards in sourceTitle plus regression coverage for malformed provider payloads. The two GitHub Actions workflows currently show action_required because this PR originates from a fork; no jobs were started yet.

@ProdigyV21

Copy link
Copy Markdown
Owner

Thanks for your work, I will look into this tomorrow.

@ProdigyV21
ProdigyV21 merged commit 3de2f77 into ProdigyV21:main Nov 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: web Changes to web or Netlify sites

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Web Sources crash: non-string stream fields can trigger t.trim is not a function

2 participants