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

Cannot use actions from within a modal widget #18

Closed
skolmer opened this issue Nov 23, 2020 · 1 comment
Closed

Cannot use actions from within a modal widget #18

skolmer opened this issue Nov 23, 2020 · 1 comment

Comments

@skolmer
Copy link
Contributor

skolmer commented Nov 23, 2020

Describe the bug
When calling API functions like requestOpenIDConnectToken() from within a modal widget we get an error message that the action is unknown or unsupported.

To Reproduce
Steps to reproduce the behavior:

  1. Add a widget to your room that uses the new openModalWidget function to open a subpage of the widget in a modal
  2. Inside of the modal use the same widget-api initialization function as provided in the examples. (Use the widget id from url for initialization)
  3. Call another action like requestOpenIDConnectToken() or setModalButtonEnabled()
  4. See error Unknown or unsupported action: widget_config or Unknown or unsupported action: set_button_enabled
PostmessageTransport.js:93 [PostmessageTransport] Sending object to https://element.some.domain:  {api: "fromWidget", widgetId: "modal_!shZJSWfZaqJCgokLcs%3Asynapse.dev.nordeck.sy…olmer%3Asynapse.some.domain_1605884505973", requestId: "widgetapi-1606142880777", action: "get_openid", data: {…}}
rageshake.js:65 [PostmessageTransport] Sending object to https://localhost:3000:  {api: "fromWidget", widgetId: "modal_!shZJSWfZaqJCgokLcs%3Asynapse.some.domain%3Asynapse.some.domain_1605884505973", requestId: "widgetapi-1606142880777", action: "get_openid", data: {…}, …}
PostmessageTransport.js:225 Uncaught (in promise) Error: Unknown or unsupported action: get_openid
    at PostmessageTransport.handleResponse (PostmessageTransport.js:225)
    at PostmessageTransport.handleMessage (PostmessageTransport.js:196)
    at PostmessageTransport.js:164

Expected behavior
The API functions should work the same as in sidepanel or room widgets.

Desktop (please complete the following information):

  • OS: Windows
  • Browser Chrome

Additional context
We are using the latest Element Build including all commits on matrix-react/js-sdk and element-web up to Nov 21, 2020

@turt2live
Copy link
Member

This would actually be a bug on the Element side - closing in favour of element-hq/element-web#15775

Thanks for the detail! It helps a lot more than what I wrote on the element-web issue 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants