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

Don't make requests when importing subscriptions #5617

Conversation

ChunkyProgrammer
Copy link
Member

@ChunkyProgrammer ChunkyProgrammer commented Aug 27, 2024

Don't make requests when importing subscriptions

Pull Request Type

  • Bugfix

Related issue

Description

A simplified version of #4340 that doesnt worry about having a lot of logic for fetching thumbnails if it's missing, the thumbnails can be fetched from other places (visiting the channel, refreshing subscriptions with local api + no rss)

Screenshots

Testing

See: #3735 (comment) & #4340

Change file extension .txt to .db

(Notice how much faster importing subscriptions is)

Desktop

  • OS: Linux Mint
  • OS Version: 22
  • FreeTube version: latest nightly

@ChunkyProgrammer ChunkyProgrammer marked this pull request as ready for review August 27, 2024 21:08
@FreeTubeBot FreeTubeBot enabled auto-merge (squash) August 27, 2024 21:08
@github-actions github-actions bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Aug 27, 2024
@PikachuEXE
Copy link
Collaborator

Hi error~
image

Copy link
Member

@absidue absidue left a comment

Choose a reason for hiding this comment

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

I haven't got round to testing this yet, but the code looks good.

absidue
absidue previously approved these changes Aug 28, 2024
@PikachuEXE
Copy link
Collaborator

Oops more errors
image
image

@ChunkyProgrammer
Copy link
Member Author

@PikachuEXE found the issue, interestingly, this error could happen when not using this PR

@ChunkyProgrammer ChunkyProgrammer force-pushed the dont-make-requests-when-importing-subscriptions branch from ee4aff6 to 91ef230 Compare August 29, 2024 02:10
@PikachuEXE
Copy link
Collaborator

Duplicate keys detected: 'UC59AcfHD5jOGqTxb-zAsahw'. This may cause an update error.
image

@ChunkyProgrammer
Copy link
Member Author

@PikachuEXE you're somehow subscribed to the same channel multiple times, not sure how that happened

@ChunkyProgrammer
Copy link
Member Author

ChunkyProgrammer commented Aug 29, 2024

I think the double subscribe issue should be fixed here: 60a11d3 (you'll need to unsubscribe from the duplicate manually)

Copy link
Member

@absidue absidue left a comment

Choose a reason for hiding this comment

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

Looks good to me now. There are a few things that would be nice to have but are non-blocking:

  • It's probably not worth keeping the progress bar logic anymore as the import is so fast now that there is probably more overhead in updating the progress than in the processing itself (additionally the progress bar has a 500ms animation, so when the import finishes in less than 60ms the progress bar will visually probably only reach 10% before we hide it).
  • I was premature in suggesting that the async keyword should be removed, it's probably worth awaiting the this.updateProfile() calls as they are asynchronous, so we only show the All subscriptions have been successfully imported toast once we know that the data has actually been saved. (if this is done, I would suggest adding back the This might take a while, please wait toast in all places that it was removed)

Copy link
Member

Choose a reason for hiding this comment

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

works like a charm

Copy link
Collaborator

@PikachuEXE PikachuEXE left a comment

Choose a reason for hiding this comment

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

Duplicate keys issue fixed

@FreeTubeBot FreeTubeBot merged commit 7c4e2de into FreeTubeApp:development Sep 2, 2024
5 checks passed
@github-actions github-actions bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label Sep 2, 2024
@ChunkyProgrammer ChunkyProgrammer deleted the dont-make-requests-when-importing-subscriptions branch September 2, 2024 01: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
5 participants