ngxs / store

🚀 NGXS - State Management for Angular
http://ngxs.io
MIT License
3.53k stars 399 forks source link

🐞[BUG]: Weird indentation on ngxs-logger (is the cancelComplete: true working?) #1657

Open saffabook opened 4 years ago

saffabook commented 4 years ago

Affected Package

The issue is caused by package @ngxs-logger-plugin.js

Description

Weird indentation on ngxs-logger.

I am following this tutorial, particularly the {cancelCompleted: true} functionality for NGXS.

If you follow the video, you will see him click quickly on an order to demonstrate how the request is cancelled followed by a new request. However in his example, his ngxs-logger, the console log indents with the request, and then it all resets when completed. I have an image of it below. Also you can see several green Next State comments. Also have a look at the video to see what I mean. image

However with mine, my ngxs-logger remains indented and never resets. I have an image below to explain what I mean. Also I have only one green next state despite clicking multiple times. My server is on a 3 second delay so I can mimic any lag. Does this lag have anything to do with it? image

Hi I have written a more in depth article on stack overflow.

I have the exact code I am using on Stackblitz

Why would my ngxs-logger behave differently to the tutorial.

Many thanks.

splincode commented 4 years ago

@arturovt what do you think?

saffabook commented 4 years ago

anybody out there?

splincode commented 4 years ago

@ngxs/core ping

saffabook commented 3 years ago

@ngxs/core ping ping ding aling?

splincode commented 3 years ago

@saffabook if you can investigate problem, maybe will be can you create PR for fix current bug?

kovaldenys96 commented 3 years ago

I have the similar issue. So, I dispatch event with async handler multiple times and cancel all of them. After it, all new actions will be logged on the some level above in the console (equivalent to the canceled actions).

important to note that actions are really canceled, just logging-plugin doesn't reset the depth of logs.