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 crash in Feeds and Starter Packs #4616

Merged
merged 3 commits into from
Jun 24, 2024
Merged

Fix crash in Feeds and Starter Packs #4616

merged 3 commits into from
Jun 24, 2024

Conversation

gaearon
Copy link
Collaborator

@gaearon gaearon commented Jun 24, 2024

See inline comments.

Test Plan

Add throw Error('no') here, then add it here. In both cases the Feeds page should be able to recover, and show the rest instead. Similarly start pack creation should recover in both cases.

Copy link

render bot commented Jun 24, 2024

: savedFeeds.concat(
popularFeeds.filter(f => !savedFeeds.some(sf => sf.uri === f.uri)),
)
const suggestedFeeds = savedFeeds.concat(
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not essential to the fix, but this wasn't doing anything and made the code more complicated.

})
} else if (savedItem.type === 'feed') {
const resolvedFeed = resolvedFeeds.get(savedItem.value)
if (resolvedFeed) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the fix.

}
} else if (savedItem.type === 'list') {
const resolvedList = resolvedLists.get(savedItem.value)
if (resolvedList) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this.

? resolvedFeeds.get(s.value)
: resolvedLists.get(s.value),
}
}) as SavedFeedItem[]
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was covering up the mistake.

@gaearon gaearon changed the title Fix crash in Explore and Starter Packs Fix crash in Feeds and Starter Packs Jun 24, 2024
Copy link

Old size New size Diff
6.47 MB 6.47 MB 86 B (0.00%)

@gaearon gaearon merged commit f64245c into main Jun 24, 2024
6 checks passed
@gaearon gaearon deleted the fix-bug branch June 24, 2024 20:34
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.

2 participants