Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

[MM-18340] Proposed fix for 'dialog not opening' bug #3617

Closed
wants to merge 3 commits into from
Closed

[MM-18340] Proposed fix for 'dialog not opening' bug #3617

wants to merge 3 commits into from

Conversation

pbitty
Copy link
Contributor

@pbitty pbitty commented Sep 9, 2019

Summary

While working on mattermost/mattermost#12043, I came across this bug and attempted to fix it. If think this is an appropriate solution, I am happy to continue and make any necessary changes, and write the necessary tests. If not, please feel free to close it.

MM-18340

Ticket Link

https://mattermost.atlassian.net/browse/MM-18340

Related Pull Requests

  • None

@pbitty pbitty changed the title Implement promise-based approach [MM-18340] Proposed fix for 'dialog not opening' bug Sep 9, 2019
The integration_actions module was being loaded implicitly by another
part of the code, and it stopped being loaded in
70bae6a.

This moves it into its own module, pending a deeper refactoring.
@pbitty
Copy link
Contributor Author

pbitty commented Sep 10, 2019

/cc @lieut-data

@hanzei
Copy link
Contributor

hanzei commented Sep 11, 2019

Thanks for the fix @pbitty and sorry for getting to this late. This was fixed in the mean time with #3629. Still, thanks for working on it.

@hanzei hanzei closed this Sep 11, 2019
@pbitty pbitty deleted the MM-18340 branch September 11, 2019 19:35
@lieut-data
Copy link
Member

@pbitty, thanks for this -- your solution is still interesting to me. I worked around the original problem of the missing import, but it seems your solution might speak to the underlying issue better. I'm a bit swamped this week, but I'd like to revisit this.

I've filed https://mattermost.atlassian.net/browse/MM-18511 linking back to this PR to investigate further.

import {ModalIdentifiers} from 'utils/constants.jsx';

export async function openInteractiveDialog(dialog) {
if (await matchesCurrentOrNextTriggerId(dialog.trigger_id)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@lieut-data, I read your comments in #3629. I think this PR may not address the following:

* it monitors the store to modify the store: this is perhaps better handled by a saga

Since await is syntactic sugar for Promises, I believe the store.dispatch() calls still happen inside the store.subscribe() callback.

@pbitty
Copy link
Contributor Author

pbitty commented Sep 12, 2019

@hanzei @lieut-data , no problem. Thanks.

I left a comment that may be relevant if you come back to this implementation.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants