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

spy.show() doesn't filter out observables that run in sync #44

Open
jecraig opened this issue Feb 21, 2019 · 6 comments
Open

spy.show() doesn't filter out observables that run in sync #44

jecraig opened this issue Feb 21, 2019 · 6 comments
Labels

Comments

@jecraig
Copy link

jecraig commented Feb 21, 2019

When using spy.show() from the console, observables that run synchronously are not filtered out of the list.

const asyncSub = new AsyncSubject();
asyncSub.next(null);
asyncSub.complete();

asyncSub.pipe(tag('nodelay.1')).subscribe();
asyncSub.pipe(tag('nodelay.2')).subscribe();

asyncSub
	.pipe(
		tag('delay.1'),
		delay(1),
	)
	.subscribe();

asyncSub
	.pipe(
		tag('delay.2'),
		delay(1),
	)
	.subscribe();

spybug

@cartant
Copy link
Owner

cartant commented Feb 21, 2019

Why is that a problem? It states that they are complete. There will be more advanced querying capabilities in rxjs-devtools, but this is not something that I intend to fix/change here.

Completed subscriptions will continue to be shown until the keptDuration elapses.

@jecraig
Copy link
Author

jecraig commented Feb 21, 2019

I've actually got keptDuration set to zero in the demo. So they should have been wiped. As you can see, the other two tags were removed and they subscribed after the synchronous ones.

The issue is I'm combing through my site looking for any leaky subscriptions. Since the synchronous ones aren't removed, they become red-herrings. A work around is to add a delay(1) to the pipe, but that's altering code to fix a debug tool.

Also, I understand you're working on rxjs-devtools. I'm mostly logging this because it dogged me for two days and I'm hoping to spare others.

@cartant
Copy link
Owner

cartant commented Feb 21, 2019

Try setting it to a small, non-zero number.

@cartant
Copy link
Owner

cartant commented Feb 21, 2019

I'll add your synchronous AsyncSubject scenario as a test in rxjs-devtools is it's a problem there and the same solution applies to rxjs-spy, I will fix it.

cartant added a commit that referenced this issue Feb 21, 2019
@cartant
Copy link
Owner

cartant commented Feb 21, 2019

I added some sync tests for the graph flushing to rxjs-devtools and they passed. I've added the same tests here and they too pass. I'm not going to look further into this because although the graphing implementation is pretty much unchanged, the snapshotting implementation in rxjs-devtools is completely different.

@cartant
Copy link
Owner

cartant commented Feb 22, 2019

FYI, I've added tests to rxjs-devtools to determine whether or not snapshots for completed subscriptions are flushed correctly when snapshotting - based on the keptDuration - and, yes, they appear to be.

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

No branches or pull requests

2 participants