Skip to content

Embedder API should support receiving responses from messages #18852

Closed
flutter-team-archive/engine
#9655

Description

@stuartmorgan-g

Per the embedding header's description of FlutterPlatformMessage's response_handle:
// The response handle on which to invoke
// |FlutterEngineSendPlatformMessageResponse| when the response is ready. This
// field is ignored for messages being sent from the embedder to the
// framework.

This means FlutterEngineSendPlatformMessage can't receive responses from messages sent into Flutter, which is inconsistent with the messaging APIs on mobile.

This is especially problematic given that MethodChannel eats all exceptions that happen during message processing and turns them into error responses; if it's impossible to set up a handler to receive those responses on the native side, debugging problems is very painful. (E.g., google/flutter-desktop-embedding#80 took me several unnecessary hours to debug because the type exception was being silently dropped.)

Activity

  1. stuartmorgan-g commented on Jun 26, 2018

    @stuartmorgan-g
    ContributorAuthor
  2. self-assigned this
    on Jun 26, 2018
  3. added
    e: embedderUsers of the Embedder API
    engineflutter/engine related. See also e: labels.
    on Jun 26, 2018
  4. chinmaygarde commented on Jun 26, 2018

    @chinmaygarde
    Contributor

    Please feel free to file more issue related to debugging experience while working with the embedder API.

  5. GeertJohan commented on Mar 14, 2019

    @GeertJohan

    Is this on the roadmap? I'd love to implement replies to host->client messages for go-flutter.

  6. self-assigned this
    on Jul 2, 2019
  7. AndruByrne commented on Jul 31, 2019

    @AndruByrne

    Chinmay, I hope you take this the right way, but I could kiss you; thanks for fixing the bug I just spent 8 hours finding!!!

    - nullptr); + response);

    nicolson_nodding

  8. stuartmorgan-g commented on Aug 21, 2019

    @stuartmorgan-g
    ContributorAuthor

    @smanilov Thanks, good catch. Filed #38977 to add the last missing bits that had referenced this.

  9. franciscojma86 commented on Sep 4, 2019

    @franciscojma86
    Contributor

    Landed! Thanks for the heads up!

  10. smanilov commented on Sep 20, 2019

    @smanilov

    Thanks a lot for following up! I'll use this right away :)

  11. github-actions commented on Aug 28, 2021

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  12. locked as resolved and limited conversation to collaborators on Aug 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions