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

AppB is able to modify store in AppA that doesn't have registered global actions #25

Open
harishajdarevic opened this issue May 25, 2021 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@harishajdarevic
Copy link

harishajdarevic commented May 25, 2021

Describe the bug
Hi everyone,

I'm playing arround with this library and I found out that I'm able to update state from AppA -> AppB even if AppB doesn't have registered global actions.

AppA:

            this.globalStore = GlobalStore.Get(false);
            this.globalStore.CreateStore('MFAppStore', MfReducer, []);
            this.globalStore.RegisterGlobalActions('MFAppStore', null);

AppB:

                this.globalStore = GlobalStore.Get(false);
                this.globalStore.CreateStore('GlobalAppStore', GlobalReducer, []);
                this.globalStore.RegisterGlobalActions('GlobalAppStore', [INCREMENT_GLOBAL, DECREMENT_GLOBAL]);

I'm able to dispatch action from AppB to AppA and modify the 'MFAppStore' even if there are not registered global actions.

In documentation ( readme ) it says:

this.globalStore.DispatchAction("App1", action); // This will dispatch the action to current app's store as well other stores who might have registered 'Action-1' as a global action

but it seems that it doesn't work as it is intended or I'm missing something?

Or it was always allowed?

Thanks

@harishajdarevic harishajdarevic added the bug Something isn't working label May 25, 2021
@patrickCode patrickCode self-assigned this May 26, 2021
@patrickCode
Copy link
Contributor

Ideally this shouldn't happen. Can you please give me an example of which action is modifying MFAppStore, and how are you dispatching it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants