From 705110aa120fb9180425252c755d499cf086f5ff Mon Sep 17 00:00:00 2001 From: ChanHo Lee Date: Sun, 5 Apr 2026 14:57:50 +0900 Subject: [PATCH 1/3] [ZEPPELIN-6387] Fix WebSocket reconnection not reloading note in Angular UI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### What is this PR for? Fixes an issue where WebSocket reconnection in the new Angular UI (zeppelin-web-angular) does not reload the current note, causing "Note is null" errors when attempting to run paragraphs after reconnection. ### What type of PR is it? Bug Fix ### What is the Jira issue? https://issues.apache.org/jira/browse/ZEPPELIN-6387 ### How should this be tested? 1. Open any notebook in the new Angular UI. 2. Trigger a WebSocket timeout by switching to another browser tab or window and leaving the Zeppelin tab in the background for a few minutes. - Even without interacting with the browser, you can confirm that the WebSocket has reconnected by checking the server logs. 3. Allow the system to automatically reconnect. 4. Try running any paragraph → It should fail before this PR and succeed after applying this PR. ### Questions: * Does the license files need to update? No * Is there breaking changes for older versions? No * Does this needs documentation? No Closes #5129 from tbonelee/websocket-reconnection. Signed-off-by: ChanHo Lee --- .../projects/zeppelin-sdk/src/message.ts | 20 +++++++++++- .../workspace/notebook/notebook.component.ts | 31 +++++++++++++------ 2 files changed, 41 insertions(+), 10 deletions(-) diff --git a/zeppelin-web-angular/projects/zeppelin-sdk/src/message.ts b/zeppelin-web-angular/projects/zeppelin-sdk/src/message.ts index f63f693fe88..29a05ddf8ca 100644 --- a/zeppelin-web-angular/projects/zeppelin-sdk/src/message.ts +++ b/zeppelin-web-angular/projects/zeppelin-sdk/src/message.ts @@ -43,6 +43,7 @@ export class Message { public connectedStatus = false; public connectedStatus$ = new Subject(); private ws: WebSocketSubject> | null = null; + private wsSubscription: Subscription | null = null; private open$ = new Subject(); private close$ = new Subject(); private sent$ = new Subject>(); @@ -99,13 +100,26 @@ export class Message { if (!this.wsUrl) { throw new Error('WebSocket URL is not set. Please call setWsUrl() before connect()'); } + + // Unsubscribe from existing subscription first + if (this.wsSubscription) { + this.wsSubscription.unsubscribe(); + this.wsSubscription = null; + } + + // Then close existing WebSocket + if (this.ws) { + this.ws.complete(); + this.ws = null; + } + this.ws = webSocket>({ url: this.wsUrl, openObserver: this.open$, closeObserver: this.close$ }); - this.ws + this.wsSubscription = this.ws .pipe( // reconnect retryWhen(errors => errors.pipe(mergeMap(() => this.close$.pipe(take(1), delay(4000))))) @@ -190,6 +204,10 @@ export class Message { } destroy(): void { + if (this.wsSubscription) { + this.wsSubscription.unsubscribe(); + this.wsSubscription = null; + } if (this.ws) { this.ws.complete(); this.ws = null; diff --git a/zeppelin-web-angular/src/app/pages/workspace/notebook/notebook.component.ts b/zeppelin-web-angular/src/app/pages/workspace/notebook/notebook.component.ts index b22cd012d36..ff73912d182 100644 --- a/zeppelin-web-angular/src/app/pages/workspace/notebook/notebook.component.ts +++ b/zeppelin-web-angular/src/app/pages/workspace/notebook/notebook.component.ts @@ -435,18 +435,31 @@ export class NotebookComponent extends MessageListenersManager implements OnInit this.noteVarShareService.clear(); }); this.activatedRoute.params.pipe(takeUntil(this.destroy$)).subscribe(param => { - const { noteId, revisionId } = param; - if (revisionId) { - this.messageService.noteRevision(noteId, revisionId); - } else { - this.messageService.getNote(noteId); - } - this.revisionView = !!revisionId; + this.revisionView = !!param.revisionId; this.cdr.markForCheck(); - this.messageService.listRevisionHistory(noteId); - // TODO(hsuanxyz) scroll to current paragraph }); this.revisionView = !!this.activatedRoute.snapshot.params.revisionId; + + // Fetch note when WebSocket connects or reconnects + this.messageService.connectedStatus$ + .pipe(startWith(this.messageService.connectedStatus), takeUntil(this.destroy$)) + .subscribe(connected => { + console.log('connectedStatus$ changed to ', connected ? 'connected' : 'disconnected'); + if (connected) { + const { noteId, revisionId } = this.activatedRoute.snapshot.params; + if (!noteId) { + throw new Error('Route parameter `noteId` is required.'); + } + if (revisionId) { + this.messageService.noteRevision(noteId, revisionId); + } else { + this.messageService.getNote(noteId); + } + this.cdr.markForCheck(); + this.messageService.listRevisionHistory(noteId); + // TODO(hsuanxyz) scroll to current paragraph + } + }); } removeParagraphFromNgZ(): void { From b4193a072eda5dacae9a7ce29140aa38c21b5c75 Mon Sep 17 00:00:00 2001 From: ChanHo Lee Date: Sun, 5 Apr 2026 14:59:14 +0900 Subject: [PATCH 2/3] [ZEPPELIN-6384] Fix dropdown menu item links not clickable in full area ### What is this PR for? #### Summary - Fixed dropdown menu items in header where only text was clickable instead of the full item area - Changed routerLinkActive to nzMatchRouter for proper NG-ZORRO integration - Added CSS pseudo-element to expand clickable area of anchor tags #### Cause - Likely due to NG-ZORRO dropdown menu item anchor tag style changes that reduced the clickable area to just the text content. #### Changes - Updated `header.component.html`: Replace `routerLinkActive` with `nzMatchRouter` directive - Updated `global.less`: Add `::before` pseudo-element to `.ant-dropdown-menu-item > a` to expand clickable area using absolute positioning ### What type of PR is it? Bug Fix ### What is the Jira issue? https://issues.apache.org/jira/browse/ZEPPELIN-6384 ### Questions: * Does the license files need to update? No * Is there breaking changes for older versions? No * Does this needs documentation? No Closes #5124 from tbonelee/fix-dropdown-link. Signed-off-by: ChanHo Lee --- .../src/app/share/header/header.component.html | 10 +++++----- zeppelin-web-angular/src/styles/global.less | 8 ++++++++ 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/zeppelin-web-angular/src/app/share/header/header.component.html b/zeppelin-web-angular/src/app/share/header/header.component.html index f0dd608affa..d77aa12df72 100644 --- a/zeppelin-web-angular/src/app/share/header/header.component.html +++ b/zeppelin-web-angular/src/app/share/header/header.component.html @@ -52,19 +52,19 @@
  • About Zeppelin
  • -
  • +
  • Interpreter
  • -
  • +
  • Notebook Repos
  • -
  • +
  • Credential
  • - + -
  • +
  • Configuration
  • diff --git a/zeppelin-web-angular/src/styles/global.less b/zeppelin-web-angular/src/styles/global.less index 42e736228c1..b72478b7837 100644 --- a/zeppelin-web-angular/src/styles/global.less +++ b/zeppelin-web-angular/src/styles/global.less @@ -115,6 +115,14 @@ } } +// Fix `a` tag in nz-dropdown-menu to be clickable with full width +.ant-dropdown-menu-item > a::before { + position: absolute; + inset: 0; + background-color: transparent; + content: ''; +} + //.view-lines { // .view-line { // &:first-child { From 6f6df4cdbf02aa2f8b9731adfe926228aedb9b15 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 5 Apr 2026 21:49:32 +0900 Subject: [PATCH 3/3] Bump requests from 2.32.5 to 2.33.0 in /dev (#5196) Bumps [requests](https://github.com/psf/requests) from 2.32.5 to 2.33.0. - [Release notes](https://github.com/psf/requests/releases) - [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md) - [Commits](https://github.com/psf/requests/compare/v2.32.5...v2.33.0) --- updated-dependencies: - dependency-name: requests dependency-version: 2.33.0 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- dev/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/requirements.txt b/dev/requirements.txt index c1aa4ef539d..5d0fd9c8ea5 100644 --- a/dev/requirements.txt +++ b/dev/requirements.txt @@ -22,7 +22,7 @@ jira==3.10.5 oauthlib==3.3.1 packaging==25.0 python-dotenv==1.1.1 -requests==2.32.5 +requests==2.33.0 requests-oauthlib==2.0.0 requests-toolbelt==1.0.0 typing-extensions==4.14.1