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

Stop free scrolling on app hide #901

Merged
merged 6 commits into from
Sep 15, 2023
Merged

Conversation

andrewsavage1
Copy link
Contributor

b/290655439
b/290846002

@andrewsavage1 andrewsavage1 added the cp-24.lts.1+ Cherry Pick to the 24.lts.1+ branch label Jul 12, 2023
@andrewsavage1
Copy link
Contributor Author

@jellefoks let me know if you think I'm using the wrong lifecycle states here

Copy link
Member

@kaidokert kaidokert left a comment

Choose a reason for hiding this comment

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

Resetting scroll on Conceal/Freeze makes sense to me

@codecov
Copy link

codecov bot commented Jul 20, 2023

Codecov Report

Merging #901 (b3635ba) into main (0f2376d) will decrease coverage by 0.01%.
Report is 1 commits behind head on main.
The diff coverage is 10.00%.

@@            Coverage Diff             @@
##             main     #901      +/-   ##
==========================================
- Coverage   57.58%   57.58%   -0.01%     
==========================================
  Files        1905     1905              
  Lines       94754    94764      +10     
==========================================
+ Hits        54566    54570       +4     
- Misses      40188    40194       +6     
Files Changed Coverage Δ
...obalt/ui_navigation/scroll_engine/scroll_engine.cc 0.00% <0.00%> (ø)
cobalt/ui_navigation/scroll_engine/scroll_engine.h 0.00% <0.00%> (ø)
cobalt/dom/html_element.cc 85.24% <50.00%> (-0.07%) ⬇️

... and 10 files with indirect coverage changes

@andrewsavage1
Copy link
Contributor Author

@kaidokert @sherryzy would y'all be able to take another look after the more recent commits? Thanks!

@kaidokert
Copy link
Member

@kaidokert @sherryzy would y'all be able to take another look after the more recent commits? Thanks!

Looks fine to me, the cleanup in destructor looks correct

@andrewsavage1
Copy link
Contributor Author

andrewsavage1 commented Jul 21, 2023

Here's the current failure that I'm debugging, happens during the CancelSyncLoadsWhenSuspended black box test:

[cobalt/6330:0720/181732.787827:INFO:application.cc(1196)] Got blur event.
[DebugConsoleWebModule/6364:0720/181732.787986:INFO:application_lifecycle_state.cc(153)] SetApplicationState: kApplicationStateStarted (1) -> kApplicationStateBlurred (2)
[cobalt/6330:0720/181732.788248:FATAL:observer_list_internal.h(73)] Check failed: false. 
        base::internal::CheckedObserverAdapter::IsMarkedForRemoval() [0x56156fe7ba00]
        base::ObserverList<>::Iter::EnsureValidIndex() [0x56156fe7b194]
        base::ObserverList<>::Iter::operator++() [0x56156fe5736a]
        cobalt::browser::BrowserModule::Blur() [0x56156fe36e67]
        cobalt::browser::Application::OnApplicationEvent() [0x56156fe108f5]
        cobalt::browser::Application::HandleStarboardEvent() [0x56156fe1145c]
        SbEventHandle [0x56156cc07d78]
        starboard::shared::starboard::Application::HandleEventAndUpdateState() [0x561571e6c461]
        starboard::shared::starboard::Application::DispatchAndDelete() [0x561571e6ab3b]
        starboard::shared::starboard::Application::RunLoop() [0x561571e67a2e]
        starboard::shared::starboard::Application::Run() [0x561571e681d3]
        main [0x561571c6102e]
        __libc_start_main [0x7f53ab8ca09b]
        _start [0x56156cb3dfea]

Haven't been able to recreate it by manually sending SIGUSR1 to the cobalt process after launching it. Tried replacing the call to RemoveObserver with a PostTask that ensures it is done in the browser modular thread as splash screen destruction does, but that didn't seem to help.

I'm also noticing that Cobalt seem to crash in general during black box tests if it is hidden in some way, i.e. if I click to another window. That seems a little strange, as that is just a Blur event I believe—I wouldn't expect any constructors/destructors to be called or for the scroll engine to try to stop scrolling, so something else must be going on. I wonder if the lifecycle abstract events expect a certain call to be made in their implementation.

@andrewsavage1
Copy link
Contributor Author

andrewsavage1 commented Aug 7, 2023

Even after 3623b78 (#901) I'm still occasionally running into the failing IsDesignated DCHECK in TopmostEventTarget. This happened when messing around on the secondary side nav for the settings page.

@andrewsavage1
Copy link
Contributor Author

Even after 3623b78 (#901) I'm still occasionally running into the failing IsDesignated DCHECK in TopmostEventTarget. This happened when messing around on the secondary side nav for the settings page.

Oh, well of course it didn't, I didn't use the previous_html_element_weak_ pointer in the call to DispatchPointerEventsForScrollStart. Fixed in ed06432 (#901)

b/290655439
b/290846002

Change-Id: I11dc576104b4cac75537ed95392a6f175d4dc4b3
Causes a gn check error due to scroll engine depending on lifecycle observer.

b/290846002
@andrewsavage1 andrewsavage1 merged commit 55656d5 into youtube:main Sep 15, 2023
341 of 342 checks passed
@andrewsavage1 andrewsavage1 deleted the fix/scroll branch September 15, 2023 17:13
@andrewsavage1
Copy link
Contributor Author

Merging to unblock Sherry in writing black box tests, but we'll keep an eye on if we see regressions in scroll behavior

cobalt-github-releaser-bot pushed a commit that referenced this pull request Sep 15, 2023
b/290655439
b/290846002

(cherry picked from commit 55656d5)
andrewsavage1 added a commit that referenced this pull request Sep 20, 2023
Refer to the original PR: #901

b/290655439
b/290846002

Co-authored-by: Andrew Savage <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cp-24.lts.1+ Cherry Pick to the 24.lts.1+ branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants