JangAyeon opened a new pull request, #5322:
URL: https://github.com/apache/zeppelin/pull/5322
### What is this PR for?
Destroying a notebook paragraph did not tear down its own long-lived
subscriptions or the shortcut key listeners it registered. ngOnDestroy() only
called super.ngOnDestroy(), which (via MessageListenersManager) unsubscribes
the @MessageListener subscriptions but never touches destroy$.
Subscriptions gated on takeUntil(this.destroy$) - keyBinderService.keyEvent(),
angularContextManager.runParagraphAction(), and .contextChanged() - are on
singleton services, so a destroyed paragraph instance stayed reachable and kept
receiving callbacks after being removed from the DOM. The shortcut keydown
listeners registered by KeyBinder via shortcutService.bindShortcut() were also
never released.
This PR emits and completes destroy$ in ngOnDestroy, after
super.ngOnDestroy(), matching the pattern already used in result.component.ts
and dynamic-forms.component.ts.
### What type of PR is it?
Bug Fix
### Todos
- [x] Emit and complete destroy$ in paragraph ngOnDestroy
### What is the Jira issue?
[ZEPPELIN-6532](https://issues.apache.org/jira/browse/ZEPPELIN/6532)
### How should this be tested?
* `cd zeppelin-web-angular && npm run lint`
* At runtime, subscribe to a paragraph component's destroy$, then remove it
(or navigate away): before the fix destroy$ never completes even though the
paragraph is removed from the DOM; after the fix it completes on destroy, and
the keyEvent/runParagraphAction/contextChanged subscriptions stop firing along
with the shortcut keydown listeners.
### Questions:
* Does the license files need to update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? No
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]