ionic4-auto-complete
ionic4-auto-complete copied to clipboard
RXJS subscriptions not always cleared
I'm submitting a
- [ ] Regression (a behavior that used to work and stopped working in a new release)
- [X] Bug report
- [ ] Enhancement
- [ ] Feature request
- [ ] Documentation issue or request
Description
- [X] Bug: Rxjs subscription not removed in all cases
- [ ] Feature: Description of the feature. Cause and its Motivation_
RXJS will keep sending updates until it is completed. I use this over a list that constantly pushes updates and the autocomplete itself keeps coming and going. This leaves a number of these subscriptions open consuming memory and processing useless code on the update of the initial list.
I have implemented a work around by using take(1) on my subscription however this bug is not obvious. I only found it as a result of looking at the code. There is also a slight possibility that the wrong list could be displayed, I never saw it happen however.
This also introduces a lookup when the list is cleared. Our testers considered it an error that I entered part of the values then the list just disappeared entirely. This is a breaking change as the results are different from the previous version.
Version Information
ionic4-auto-complete: 2.9.9
@angular/cli: 10.0.2
Browser
- [ ] Chrome - 105.0.5195.102
NOTE: Replace x.x.x
with your version information
https://github.com/jrquick17/ionic4-auto-complete/pull/120