Skip to content

Conversation

@xu-baolin
Copy link
Member

@xu-baolin xu-baolin commented Sep 22, 2022

Fixes #112020
This is a further improvement of #111445, and fixes two issues,

  1. The new controller cannot be subscribed to;
  2. The old extent will have memory leaks.

CC @moffatman @Piinks

@flutter-dashboard flutter-dashboard bot added f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels. labels Sep 22, 2022
Copy link
Member Author

Choose a reason for hiding this comment

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

Currently, the new controller is also related to the old extent, so we need to switch the callbacks to the new extent.

Copy link
Member Author

Choose a reason for hiding this comment

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

Without this may cause some memory leaks.

Copy link
Contributor

Choose a reason for hiding this comment

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

Nice

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we have two lists, to verify that the event is not sent to the wrong controller?

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually, the old extent will never trigger an event but keep a reference for the DraggableScrollableController.

@Piinks
Copy link
Contributor

Piinks commented Sep 26, 2022

#111445 was reverted in #112293

The internal screenshot failure was an SVG icon in the shape of an arrow that broke because it became a flat line. Custom semantics were applied to the icon to make it a button. The semantics were also lost in the test failure, the button did not appear in the semantics tree anymore.

@xu-baolin would you like to re-add the changes from #111445 here and I can test it to see if your additional changes fix these issues? Or would you like to re-land your change separately @moffatman?

#111445 did fix a customer issue (#112020) where the customer was swapping out the entire DSS for another one in response to the extents changing, so re-landing #111445 is important to them.

Let me know how you'd like to proceed, I am happy to help.

@moffatman
Copy link
Contributor

Can we have a code sample to reproduce the failure, I don't understand how that could have happened, unless the SVG is relying on being rebuilt when only layout is changed? Which is an error in the SVG side.

@Piinks
Copy link
Contributor

Piinks commented Sep 26, 2022

I am working on trying to get some sample code. The customer code is complex, I am trying to get as simple a repro as possible.

@Piinks
Copy link
Contributor

Piinks commented Sep 26, 2022

The svg and semantics failures were a red herring.

The customer code takes a different path with these changes. I've been working on the customer code directly to see if I can resolve it on their end, and I think I have it. They are passing widget states around so I am thinking this is a bug in their code, I am chatting with them to see if we can resolve it internally and re-land the changes in #111445 along with this PR.

@moffatman
Copy link
Contributor

Before #111010, you would get a rebuild every frame during drag. After that PR you should only get 1 build, at the beginning. It sounds like I guess their SVG was depending on a rebuild to update itself?

@xu-baolin
Copy link
Member Author

xu-baolin commented Sep 27, 2022

Before #111010, you would get a rebuild every frame during drag. After that PR you should only get 1 build, at the beginning. It sounds like I guess their SVG was depending on a rebuild to update itself?

Probably, could you help with reland
#111010. I will reland #111445 today.

@moffatman
Copy link
Contributor

@xu-baolin If you can combine with #111010, i would really appreciate it 😀

@xu-baolin
Copy link
Member Author

We should better separate them in case of one of those needing reverting again.😀

@moffatman
Copy link
Contributor

OK, but this one contains #111445 already, though, right? So I don't need to reopen that one?

@xu-baolin
Copy link
Member Author

Yes, could you help try to relanding #111010?

@Piinks
Copy link
Contributor

Piinks commented Sep 28, 2022

#112479 has landed 🎉

Copy link
Contributor

@Piinks Piinks left a comment

Choose a reason for hiding this comment

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

LGTM, although there are some merge conflicts to resolve. Thanks everyone for working to re-land all of these changes

Copy link
Contributor

Choose a reason for hiding this comment

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

Nice

@xu-baolin xu-baolin added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 29, 2022
@auto-submit auto-submit bot merged commit 5c52299 into flutter:master Sep 29, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 29, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Sep 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cast Error thrown from DraggableScrollableSheet

3 participants