Skip to content

Conversation

@KristjanESPERANTO
Copy link
Collaborator

This migrates the Newsfeed module to use the centralized HTTPFetcher class (introduced in #4016), following the same pattern as the Calendar module.

This continues the refactoring effort to centralize HTTP error handling across all modules.

Changes

NewsfeedFetcher:

node_helper.js:

  • Updated error handler to use errorInfo.translationKey
  • Simplified property access (fetcher.url, fetcher.items)

Cleanup:

  • Removed js/module_functions.js (scheduleTimer no longer needed)
  • Removed #module_functions import from package.json

Related

Part of the HTTPFetcher migration effort started in #4016.
Next candidate: Weather module (client-side → server-side migration).

Migrates the Newsfeed module to use the centralized HTTPFetcher class
introduced in MagicMirrorOrg#4016, following the same pattern as the Calendar module.

Changes:
- Refactored NewsfeedFetcher from function constructor to ES6 class
- Replaced manual fetch() + timer handling with HTTPFetcher composition
- Uses structured error objects with translation keys
- Inherits smart retry strategies (401/403, 429, 5xx backoff)
- Inherits timeout handling (30s) and AbortController
- Removed js/module_functions.js (scheduleTimer no longer needed)
- Removed #module_functions import from package.json
@rejas rejas merged commit 5c1cc47 into MagicMirrorOrg:develop Jan 29, 2026
9 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.

3 participants