Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: no longer short-circuit the news feed fetch #442

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

VirtualFreeEx
Copy link

@VirtualFreeEx VirtualFreeEx commented Aug 6, 2024

Abstract:
Previously, if a Medium news feed fetch failed (for example, if it is blocked by a firewall), the entire fetchNewsFeedData() function would short-circuit and throw a { number, string } error, preventing the GitHub releases-based news from being displayed.

This pull request changes this behaviour to instead return a fallback news post to notify the user of a failed Medium news fetch.

Considerations:

  1. Should a fallback blog post be returned? Should the error be displayed in a different way, if at all?
  2. Should the same handling be done for the GitHub Release news function?
  3. Should feedFetchAttempt?.status !== 200 be used in the fetchMediumNews() function?

Testing done:
The fetchMediumNews() function works fine both on failure and on success, not failing/short-circuiting the rest of fetchNewsFeedData() function.

Previously, if a Medium news feed fetch failed
(for example, if it is blocked by a firewall), the entire
fetchNewsFeedData() function would short-circuit and throw a
{ number, string } error, preventing the GitHub releases-based news
from being displayed.

This commit fixes it by returning a fallback news
item in case a Medium news fetch fails.
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