Skip to content

[ZEPPELIN-6550] Fix trash detection in note view so trashed notes can be permanently deleted#5336

Merged
voidmatcha merged 1 commit into
apache:masterfrom
kimyenac:ZEPPELIN-6550
Jul 26, 2026
Merged

[ZEPPELIN-6550] Fix trash detection in note view so trashed notes can be permanently deleted#5336
voidmatcha merged 1 commit into
apache:masterfrom
kimyenac:ZEPPELIN-6550

Conversation

@kimyenac

Copy link
Copy Markdown
Contributor

What is this PR for?

In the new Angular UI, opening a note that lives in the Trash showed the normal Move to trash action instead of Remove permanently, so a trashed note could not be permanently deleted from the note view — confirming the action re-nested it deeper into Trash (/~Trash/~Trash/...). The cron scheduler button also stayed enabled for trashed notes.

Root cause: NoteStatusService.isTrash used note.name.split('/')[1]. Since ZEPPELIN-4041 the backend sets Note.name to the last path segment only (no /), so that index is always undefined and isTrash always returned false. The full path lives in note.path, which NoteListService.setNotes already uses correctly.

This PR:

  • Uses note.path instead of note.name in isTrash (mirrors NoteListService).
  • Navigates back to / after a permanent delete, matching moveNoteToTrash, so the view leaves the now-deleted note instead of re-fetching it and surfacing a 404.

What type of PR is it?

Bug Fix

What is the Jira issue?

How should this be tested?

  • cd zeppelin-web-angular && npm run lint
  • Create a note, move it to Trash, open it from the Trash, and confirm the action bar offers Remove permanently (not re-trash) and that the cron button is disabled. Confirming the permanent delete removes the note and returns to the home view without a 404.

Questions:

  • Does the license files need to update? No
  • Is there breaking changes for older versions? No
  • Does this needs documentation? No

🤖 Generated with Claude Code

@voidmatcha

Copy link
Copy Markdown
Member

The CI failures here look mostly like a stale base — this branch is ~20 commits behind master, from before the npm-audit hotfix and the recent e2e stabilization landed. Could you rebase onto latest master? 🙏

… be permanently deleted

NoteStatusService.isTrash used note.name.split('/')[1], but since
ZEPPELIN-4041 the backend sets Note.name to the last path segment only,
so that index is always undefined and isTrash always returned false. The
full path lives in note.path, which NoteListService already uses.

As a result, opening a note from the Trash showed "Move to trash"
(re-nesting it into /~Trash/~Trash/...) instead of "Remove permanently",
and the cron scheduler button stayed enabled for trashed notes.

- Use note.path instead of note.name in isTrash (mirrors NoteListService).
- Navigate back to '/' after permanent delete, matching moveNoteToTrash,
  so the view leaves the now-deleted note instead of re-fetching it (404).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@kimyenac

Copy link
Copy Markdown
Contributor Author

Thanks for catching that! You're right, the base was stale. I've rebased onto the latest master (now on top of a31975a05, which includes the npm-audit hotfix and the e2e stabilization changes) and force-pushed. CI should run against a fresh base now. 🙏

@voidmatcha voidmatcha left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@voidmatcha
voidmatcha merged commit de9f896 into apache:master Jul 26, 2026
18 checks passed
@voidmatcha

Copy link
Copy Markdown
Member

Merged into master (de9f896).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants