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

Blacklisted actions still contribute to the actions history #316

Closed
apendua opened this issue Mar 3, 2017 · 8 comments
Closed

Blacklisted actions still contribute to the actions history #316

apendua opened this issue Mar 3, 2017 · 8 comments
Projects

Comments

@apendua
Copy link

apendua commented Mar 3, 2017

I would like to hide some type of actions in Redux DevTools history. In the documentation I've found an information about actionsBlacklist option, which I am passing to

window.__REDUX_DEVTOOLS_EXTENSION__(...)

This has some effect, i.e. I no longer see the blacklisted actions, but behind the scenes they still contribute to the history length, so instead of seeing the history of default length (50) I can only see a couple of most recent actions that has not yet been pushed back but the blacklisted ones.

Looks like increasing the history length, which as far as I understand is controlled by the maxAge option, helps a bit but it feels like a workaround rather than a real solution.

I am wondering if there's a better way to fix this behavior which I described above and if it's even intended or just a BUG?

@zalmoxisus
Copy link
Owner

zalmoxisus commented Mar 3, 2017

I know this is confusing, we should add more details about it in the docs. The intention is indeed to only hide those action on the monitor part. So they are only not being sent to the extension, but are still present in the lifted state history on the client side. Skipping those actions at all would lead to an inconsistent state during hot reloading and other devtools actions (which invokes recomputing the reducers with all the action objects from the history). In other words, redux-devtools-instrument stores those actions, but the extension not. Since maxAge is applied to redux-devtools-instrument, it affects the "real" history length, not the actions showed in the extension's monitors. It's good to keep the behaviour of this parameter as is, because it determines how much RAM will be consumed on the client side (not the extension part).

So, you're doing everything right, if you need redux-devtools-instrument to handle more actions, you should increase the value of maxAge.

If you have any ideas on how to describe this better in the docs, a PR would be much appreciated.

@apendua
Copy link
Author

apendua commented Mar 3, 2017

@zalmoxisus Thanks! Looks like it's a difficult case to solve then.

@funwithtriangles
Copy link

This is affecting my project too. My app has some actions that are firing multiple times a second. I have blacklisted these, but because of the limit imposed with maxAge, it is making all other actions in the log invisible.

The solution I have for now is to increase maxAge and latency. Unfortunately this means that the actions I want to see appear in the log for a few seconds and then disappear!

@hackhat
Copy link

hackhat commented Sep 7, 2018

Any solution for this?

@Venryx
Copy link

Venryx commented Nov 17, 2018

I have the same issue. Looks like I'll have to remove some frequently-firing actions from the redux store and instead use an alternate system, as this issue currently makes inspecting the other actions impossible.

@zalmoxisus
Copy link
Owner

I introduced the concept of dynamic maxAge in zalmoxisus/redux-devtools-instrument#22, so on the extension part we can readjust it every time a current action was blacklisted. Should have this in next version, no changes needed from client side. However, it will be also possible to readjust it by passing a function for maxAge, which will get current action as argument (so you can change depending on the type or payload). But for most of cases it will work out of box providing a number, which will be automatically changed depending on whitelisted actions.

@zalmoxisus
Copy link
Owner

It's implemented in 2.16, which will land in a day on Chrome Store. It works only for balcklisted/whitelisted actions. For predicate it would require a major refactoring as the state is computed after maxAge is called.

@Venryx
Copy link

Venryx commented Nov 27, 2018

Thanks for the addition. I'll try it out at some point, when I'm back on the project I had the issue in.

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

No branches or pull requests

5 participants