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

server: fix bulk add preview caching #1787

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

Conversation

IchanP
Copy link

@IchanP IchanP commented Aug 19, 2024

Fix #1289. Also filters videos that failed to fetch from being returned to the client.

@IchanP IchanP requested a review from dyc3 as a code owner August 19, 2024 05:15
Copy link
Owner

@dyc3 dyc3 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

It doesn't look like this accounts for partial successes. If the add preview only partially succeeds (eg. if 2 video links are requested, but only 1 video is returned), the request will still get cached in the user's browser.

Comment on lines +279 to +280
} else if (videoKeys.length > 2) {
return video;
Copy link
Owner

Choose a reason for hiding this comment

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

What is this branch here for?

Copy link
Author

Choose a reason for hiding this comment

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

You're right it's still broken. I don't think this approach is correct, I'll revise it.

The branch is to only return the video if the video is found in the cache, since it should contain more than the VideoId fields then.

Copy link
Owner

Choose a reason for hiding this comment

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

This is incorrect behavior then. We need to be able to return videos that were not already in the cache.

Copy link

codecov bot commented Aug 19, 2024

Codecov Report

Attention: Patch coverage is 70.00000% with 6 lines in your changes missing coverage. Please review.

Project coverage is 61.6170%. Comparing base (07505a7) to head (273d026).

Files Patch % Lines
server/infoextractor.ts 70.0000% 6 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff                @@
##             master      #1787        +/-   ##
================================================
+ Coverage   61.6161%   61.6170%   +0.0008%     
================================================
  Files           169        169                
  Lines         25443      25454        +11     
  Branches       1447       1449         +2     
================================================
+ Hits          15677      15684         +7     
- Misses         9712       9716         +4     
  Partials         54         54                

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

Bulk add previews that completely fail to fetch any videos can get their response cached
2 participants