Skip to content

Always finish the timeline event logged by Element.inflateWidget - #101794

Merged
fluttergithubbot merged 1 commit into
flutter:masterfrom
jason-simmons:bug_101379
Apr 13, 2022
Merged

fluttergithubbot merged 1 commit into
flutter:masterfrom
jason-simmons:bug_101379

Conversation

@jason-simmons

Copy link
Copy Markdown
Member

Fixes #101379

@flutter-dashboard

Copy link
Copy Markdown

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@flutter-dashboard flutter-dashboard Bot added the framework flutter/packages/flutter repository. See also f: labels. label Apr 12, 2022
@goderbauer

Copy link
Copy Markdown
Member

Is it possible to add a test for this, maybe to https://github.com/flutter/flutter/blob/master/dev/tracing_tests/test/timeline_test.dart?

@goderbauer

goderbauer commented Apr 12, 2022 •

Copy link
Copy Markdown
Member

/cc @chunhtai FYI

@goderbauer

Copy link
Copy Markdown
Member

Tapping on the green square in the app below exercises the code path that doesn't finish the timeline event and reproduces the problem. The Container widget will have a start event, but no corresponding end event.

@jason-simmons Maybe you can turn this into an integration test similar to how it is done in dev/tracing_tests/test/inflate_widget_tracing_test.dart.

import 'package:flutter/material.dart';

void main() {
  runApp(const MyHomePage());
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key}) : super(key: key);

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  final Key globalKey = GlobalKey();
  Key localKey = UniqueKey();

  @override
  Widget build(BuildContext context) {
    return Center(
      key: localKey,
      child: GestureDetector(
        onTap: () {
          setState(() {
            localKey = UniqueKey();
          });
        },
        child: Container(
          color: Colors.green,
          key: globalKey,
          width: 100,
          height: 100,
        ),
      ),
    );
  }
}

@jason-simmons

Copy link
Copy Markdown
Member Author

Added a test

@goderbauer goderbauer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@fluttergithubbot
fluttergithubbot merged commit c62d103 into flutter:master Apr 13, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 13, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Apr 13, 2022
CaseyHillers pushed a commit to CaseyHillers/flutter that referenced this pull request Apr 20, 2022
CaseyHillers pushed a commit that referenced this pull request Apr 20, 2022
…102193)

* Ensure that the engine frame callbacks are installed if the first scheduled frame is a forced frame (#101544)

See #98419

* Migrate common buttons to Material 3 (#100794)

* Always finish the timeline event logged by Element.inflateWidget (#101794)

* 'Create candidate branch version flutter-2.13-candidate.0 for beta'

* 'Update Engine revision to 24a02fa5ee681840cdc842c22f4cb4bdd5ec3115 for beta release 2.13.0-0.2.pre'

* Update release-candidate-branch.version

Co-authored-by: Jason Simmons <[email protected]>
Co-authored-by: Darren Austin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Track widget builds is broken

3 participants