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

Filter items being cached from "Keep for offline playing" #23020

Merged
merged 2 commits into from
Apr 11, 2024

Conversation

sangwoo108
Copy link
Contributor

Resolves brave/brave-browser#37469

We shouldn't try to cache items that are already being cached.

Submitter Checklist:

  • I confirm that no security/privacy review is needed and no other type of reviews are needed, or that I have requested them
  • There is a ticket for my issue
  • Used Github auto-closing keywords in the PR description above
  • Wrote a good PR/commit description
  • Squashed any review feedback or "fixup" commits before merge, so that history is a record of what happened in the repo, not your PR
  • Added appropriate labels (QA/Yes or QA/No; release-notes/include or release-notes/exclude; OS/...) to the associated issue
  • Checked the PR locally:
    • npm run test -- brave_browser_tests, npm run test -- brave_unit_tests wiki
    • npm run presubmit wiki, npm run gn_check, npm run tslint
  • Ran git rebase master (if needed)

Reviewer Checklist:

  • A security review is not needed, or a link to one is included in the PR description
  • New files have MPL-2.0 license header
  • Adequate test coverage exists to prevent regressions
  • Major classes, functions and non-trivial code blocks are well-commented
  • Changes in component dependencies are properly reflected in gn
  • Code follows the style guide
  • Test plan is specified in PR before merging

After-merge Checklist:

Test Plan:

  • Add a long video to playlist
  • Open playlist ui -> go to the folder that the new item is stored.
  • Open context menu for item
  • "Keep for offline play" shouldn't exist for items that are being cached

@github-actions github-actions bot added the CI/storybook-url Deploy storybook and provide a unique URL for each build label Apr 11, 2024
@brave-builds
Copy link
Collaborator

A Storybook has been deployed to preview UI for the latest push

@brave-builds
Copy link
Collaborator

A Storybook has been deployed to preview UI for the latest push

@sangwoo108 sangwoo108 marked this pull request as ready for review April 11, 2024 05:24
@sangwoo108 sangwoo108 requested review from fallaciousreasoning and simonhong and removed request for fallaciousreasoning April 11, 2024 05:24
@simonhong
Copy link
Member

If downloading is finished while item's context menu is still visible, I can always get this crash.

[21352:259:0411/170910.564886:FATAL:playlist_media_file_downloader.cc(118)] Check failed: download_item_observation_.IsObservingSource(download.get()).
0   libbase.dylib                       0x0000000102a45412 base::debug::CollectStackTrace(void const**, unsigned long) + 18
1   libbase.dylib                       0x0000000102a288c3 base::debug::StackTrace::StackTrace() + 19
2   libbase.dylib                       0x000000010290b820 logging::LogMessage::Flush() + 176
3   libbase.dylib                       0x000000010290b6ed logging::LogMessage::~LogMessage() + 29
4   libbase.dylib                       0x00000001028e725f logging::(anonymous namespace)::DCheckLogMessage::~DCheckLogMessage() + 111
5   libbase.dylib                       0x00000001028e72be logging::(anonymous namespace)::DCheckLogMessage::~DCheckLogMessage() + 14
6   libbase.dylib                       0x00000001028e6b93 logging::CheckError::~CheckError() + 35
7   libbase.dylib                       0x00000001028e6be9 logging::CheckError::~CheckError() + 9
8   libchrome_dll.dylib                 0x000000011293a83e playlist::PlaylistMediaFileDownloader::ScheduleToDetachCachedFile(download::DownloadItem*) + 222
9   libchrome_dll.dylib                 0x000000011293b992 playlist::PlaylistMediaFileDownloader::OnDownloadUpdated(download::DownloadItem*) + 642
10  libcomponents_download_public_commo 0x000000011ac274a7 download::DownloadItemImpl::UpdateObservers() + 663
11  libcomponents_download_public_commo 0x000000011ac319d5 download::DownloadItemImpl::Completed() + 741
12  libcomponents_download_public_commo 0x000000011ac312a9 download::DownloadItemImpl::OnDownloadRenamedToFinalName(download::DownloadInterruptReason, base::FilePath const&) + 649
13  libcomponents_download_public_commo 0x000000011ac3580e base::internal::Invoker<base::internal::FunctorTraits<void (download::DownloadItemImpl::*&&)(download::DownloadInterruptReason, base::FilePath const&), base::WeakPtr<download::DownloadItemImpl>&&>, base::internal::BindState<true, true, false, void (download::DownloadItemImpl::*)(download::DownloadInterruptReason, base::FilePath const&), base::WeakPtr<download::DownloadItemImpl>>, void (download::DownloadInterruptReason, base::FilePath const&)>::RunOnce(base::internal::BindStateBase*, download::DownloadInterruptReason, base::FilePath const&) + 110
14  libcomponents_download_public_commo 0x000000011ac220a0 base::OnceCallback<void (download::DownloadInterruptReason, base::FilePath const&)>::Run(download::DownloadInterruptReason, base::FilePath const&) && + 80
15  libcomponents_download_public_commo 0x000000011ac21f2f base::internal::Invoker<base::internal::FunctorTraits<base::OnceCallback<void (download::DownloadInterruptReason, base::FilePath const&)>&&, download::DownloadInterruptReason&&, base::FilePath&&>, base::internal::BindState<false, true, true, base::OnceCallback<void (download::DownloadInterruptReason, base::FilePath const&)>, download::DownloadInterruptReason, base::FilePath>, void ()>::RunOnce(base::internal::BindStateBase*) + 47
16  libbase.dylib                       0x00000001028e22b0 base::OnceCallback<void ()>::Run() && + 64
17  libbase.dylib                       0x000000010298fcfb base::TaskAnnotator::RunTaskImpl(base::PendingTask&) + 267
18  libbase.dylib                       0x00000001029c759f base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl(base::LazyNow*) + 1551

@sangwoo108
Copy link
Contributor Author

If downloading is finished while item's context menu is still visible, I can always get this crash.

[21352:259:0411/170910.564886:FATAL:playlist_media_file_downloader.cc(118)] Check failed: download_item_observation_.IsObservingSource(download.get()).
0   libbase.dylib                       0x0000000102a45412 base::debug::CollectStackTrace(void const**, unsigned long) + 18
1   libbase.dylib                       0x0000000102a288c3 base::debug::StackTrace::StackTrace() + 19
2   libbase.dylib                       0x000000010290b820 logging::LogMessage::Flush() + 176
3   libbase.dylib                       0x000000010290b6ed logging::LogMessage::~LogMessage() + 29
4   libbase.dylib                       0x00000001028e725f logging::(anonymous namespace)::DCheckLogMessage::~DCheckLogMessage() + 111
5   libbase.dylib                       0x00000001028e72be logging::(anonymous namespace)::DCheckLogMessage::~DCheckLogMessage() + 14
6   libbase.dylib                       0x00000001028e6b93 logging::CheckError::~CheckError() + 35
7   libbase.dylib                       0x00000001028e6be9 logging::CheckError::~CheckError() + 9
8   libchrome_dll.dylib                 0x000000011293a83e playlist::PlaylistMediaFileDownloader::ScheduleToDetachCachedFile(download::DownloadItem*) + 222
9   libchrome_dll.dylib                 0x000000011293b992 playlist::PlaylistMediaFileDownloader::OnDownloadUpdated(download::DownloadItem*) + 642
10  libcomponents_download_public_commo 0x000000011ac274a7 download::DownloadItemImpl::UpdateObservers() + 663
11  libcomponents_download_public_commo 0x000000011ac319d5 download::DownloadItemImpl::Completed() + 741
12  libcomponents_download_public_commo 0x000000011ac312a9 download::DownloadItemImpl::OnDownloadRenamedToFinalName(download::DownloadInterruptReason, base::FilePath const&) + 649
13  libcomponents_download_public_commo 0x000000011ac3580e base::internal::Invoker<base::internal::FunctorTraits<void (download::DownloadItemImpl::*&&)(download::DownloadInterruptReason, base::FilePath const&), base::WeakPtr<download::DownloadItemImpl>&&>, base::internal::BindState<true, true, false, void (download::DownloadItemImpl::*)(download::DownloadInterruptReason, base::FilePath const&), base::WeakPtr<download::DownloadItemImpl>>, void (download::DownloadInterruptReason, base::FilePath const&)>::RunOnce(base::internal::BindStateBase*, download::DownloadInterruptReason, base::FilePath const&) + 110
14  libcomponents_download_public_commo 0x000000011ac220a0 base::OnceCallback<void (download::DownloadInterruptReason, base::FilePath const&)>::Run(download::DownloadInterruptReason, base::FilePath const&) && + 80
15  libcomponents_download_public_commo 0x000000011ac21f2f base::internal::Invoker<base::internal::FunctorTraits<base::OnceCallback<void (download::DownloadInterruptReason, base::FilePath const&)>&&, download::DownloadInterruptReason&&, base::FilePath&&>, base::internal::BindState<false, true, true, base::OnceCallback<void (download::DownloadInterruptReason, base::FilePath const&)>, download::DownloadInterruptReason, base::FilePath>, void ()>::RunOnce(base::internal::BindStateBase*) + 47
16  libbase.dylib                       0x00000001028e22b0 base::OnceCallback<void ()>::Run() && + 64
17  libbase.dylib                       0x000000010298fcfb base::TaskAnnotator::RunTaskImpl(base::PendingTask&) + 267
18  libbase.dylib                       0x00000001029c759f base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl(base::LazyNow*) + 1551

Thank you so much. Will create an issue for this

Copy link
Member

@simonhong simonhong left a comment

Choose a reason for hiding this comment

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

👍🏼

@sangwoo108 sangwoo108 merged commit 4924c9c into master Apr 11, 2024
19 checks passed
@sangwoo108 sangwoo108 deleted the sko/keep-for branch April 11, 2024 12:53
@github-actions github-actions bot added this to the 1.67.x - Nightly milestone Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/storybook-url Deploy storybook and provide a unique URL for each build
Projects
None yet
3 participants