jsonforms icon indicating copy to clipboard operation
jsonforms copied to clipboard

abstract-control (angular) state subscription is not cleared

Open Ketec opened this issue 1 year ago • 2 comments

Describe the bug

https://github.com/eclipsesource/jsonforms/blob/master/packages/angular/src/library/abstract-control.ts ngOnDestroy does unsubscribe, but this.jsonFormsService.$state.subscribe is never actually assigned to the variable.

So every schema change adds new subscriptions and old ones still remain active and trigger.

Expected behavior

removed controls are unsubscribed

Steps to reproduce the issue

Screenshots

No response

Which Version of JSON Forms are you using?

3.3.0

Framework

Angular

RendererSet

Other (please specify in the Additional context field)

Additional context

No response

Ketec avatar Jul 08 '24 10:07 Ketec

Hi @Ketec , thanks for the report. That indeed seems like a bug. Would you like to contribute a fix?

lucas-koehler avatar Jul 08 '24 13:07 lucas-koehler

I'm not set up to run it locally for tests ( or even how it is set up here). An open question also would be about the potential use cases with custom renderers that may extend this and use this.subscription for other observables.

It likely needs a separate property to ensure it's backwards compatible.

Ketec avatar Jul 08 '24 13:07 Ketec