-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Eric/app 745 handle custom feed failure cases #1783
Eric/app 745 handle custom feed failure cases #1783
Conversation
try { | ||
const res = await store.agent.app.bsky.feed.getFeedGenerator({ | ||
feed: uri, | ||
}) | ||
const view = res.data.view | ||
return view | ||
} catch (e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was throwing an uncaught error
str.includes('Failed to fetch') || | ||
str.includes('NetworkError when attempting to fetch resource') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just want to catch this case too
@@ -47,6 +52,7 @@ export class PostsFeedModel { | |||
isBlockedBy = false | |||
error = '' | |||
loadMoreError = '' | |||
cleanError?: PostsFeedModelError = undefined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One idea for attaching more info to the error so we know more about what happened
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This whole file is lifted from CustomFeed
screen, no functional changes.
if (isCustomFeed) { | ||
feedItems.push(FEED_INNER_HEADER) | ||
} | ||
if (feed.hasError && !isCustomFeed) { | ||
// applies to our internal algo feeds only |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's a custom feed, the error message will show within the "inner" header component, which this PR introduces. If it's not a custom feed, we show a similar looking error message outside the header as we have been.
message={feed.error} | ||
onPressTryAgain={onPressTryAgain} | ||
<FeedInnerHeader | ||
showContextMenu={showFeedHeaderContextMenu} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This prop is for use on the CustomFeed
screen, which already uses this context menu.
? isCustomFeed | ||
? [FEED_INNER_HEADER_LOADING, LOADING_ITEM] | ||
: [LOADING_ITEM] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If custom feed, show an additional skeleton UI component for the inner header
</View> | ||
</CustomFeedContextMenu> | ||
) : ( | ||
<View style={{height: 24}} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here to prevent layout shift when loaded
I like the premise of what you’re going for with the bottom bar, but I think we need a design in the tabs bar that specifically accommodates this |
Superseded by #1798 |
Adds an "inner" header to custom feeds that showcases the author and provides a context menu in places there wasn't one before. Also revises how errors are rendered in these cases.
Screen.Recording.2023-10-31.at.1.42.16.PM-1.mov