Skip to content

fix(sidecar): resolve ReferenceError for 'addresses' in isSafeUrl proxy#366

Open
nightsale wants to merge 1 commit intokoala73:mainfrom
nightsale:feature/sidecar-fix
Open

fix(sidecar): resolve ReferenceError for 'addresses' in isSafeUrl proxy#366
nightsale wants to merge 1 commit intokoala73:mainfrom
nightsale:feature/sidecar-fix

Conversation

@nightsale
Copy link

The addresses variable was defined with let inside a try block, making
it inaccessible at the final return statement. Moved the declaration outside
the try block to fix local proxy crashes causing 'No news available' errors.

Summary

The sidecar's isSafeUrl() function threw a fatal ReferenceError: addresses is not defined on every incoming request because let addresses = [] was
scoped inside the try block but referenced in the final return statement
outside it. This caused the local API server to crash in a loop, preventing
any RSS feed from being fetched on the desktop app.

Type of change

  • Bug fix

Affected areas

  • News panels / RSS feeds
  • Desktop app (Tauri)

Checklist

  • Tested on worldmonitor.app variant
  • Tested on tech.worldmonitor.app variant (if applicable)
  • New RSS feed domains added to api/rss-proxy.js allowlist (if adding feeds)
  • No API keys or secrets committed
  • TypeScript compiles without errors (npm run typecheck)

Screenshots

The sidecar logs before the fix (looping fatal crash):
[local-api] fatal ReferenceError: addresses is not defined at isSafeUrl (...local-api-server.mjs:200:43)

Tested via the desktop executable (Windows .exe) — the only context
where the sidecar runs. After the fix, the crash no longer appears in logs
and external feeds load correctly.

The 'addresses' variable was defined with 'let' inside a try block, making it inaccessible at the final return statement. Moved the declaration outside the try block to fix local proxy crashes causing 'No news available' errors.
@vercel
Copy link

vercel bot commented Feb 25, 2026

@nightsale is attempting to deploy a commit to the Elie Team on Vercel.

A member of the Team first needs to authorize it.

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