Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Bug report) Can't unshare note when it's hoisted #707

Open
perfectra1n opened this issue Dec 3, 2024 · 0 comments
Open

(Bug report) Can't unshare note when it's hoisted #707

perfectra1n opened this issue Dec 3, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@perfectra1n
Copy link

Description

Recreation steps:

  1. Create note
  2. Share it
  3. Hoist it
  4. Attempt to unshare it

Video
https://github.com/user-attachments/assets/ea18f8d9-3ed6-48c3-a80a-7f995782cb29

Logs

ERROR: delete /api/branches/:branchId threw exception: 'Can't delete root or hoisted branch/note', stack: Error: Can't delete root or hoisted branch/note
    at BBranch.deleteBranch (file:///usr/src/app/src/becca/entities/bbranch.js:135:19)
    at deleteBranch (file:///usr/src/app/src/routes/api/branches.js:152:30)
    at Function.cb (file:///usr/src/app/src/routes/routes.js:379:34)
    at Function.sqliteTransaction (/usr/src/app/node_modules/better-sqlite3/lib/methods/transaction.js:65:24)
    at Object.transactional (file:///usr/src/app/src/services/sql.js:205:52)
    at file:///usr/src/app/src/routes/routes.js:380:44
    at /usr/src/app/node_modules/cls-hooked/context.js:118:13
    at Namespace.run (/usr/src/app/node_modules/cls-hooked/context.js:97:5)
    at Namespace.runAndReturn (/usr/src/app/node_modules/cls-hooked/context.js:117:8)
    at Object.init (file:///usr/src/app/src/services/cls.js:4:22)
JS Error: 500 DELETE branches/_share_glFhxD2myVBm?taskId=no-progress-reporting - Can't delete root or hoisted branch/note
Stack: Error
    at Object.y [as logError] (http://localhost:8081/assets/v0.90.12/app-dist/desktop.js:1:139076)
    at Object.g [as throwError] (http://localhost:8081/assets/v0.90.12/app-dist/desktop.js:1:128258)
    at l (http://localhost:8081/assets/v0.90.12/app-dist/desktop.js:1:123972)
    at async Object.error (http://localhost:8081/assets/v0.90.12/app-dist/desktop.js:1:122702)
JS Error: Uncaught error: Message: 500 DELETE branches/_share_glFhxD2myVBm?taskId=no-progress-reporting - Can't delete root or hoisted branch/note, Line: undefined, Column: undefined, Error object: {}, Stack: Error: 500 DELETE branches/_share_glFhxD2myVBm?taskId=no-progress-reporting - Can't delete root or hoisted branch/note
    at Object.g [as throwError] (http://localhost:8081/assets/v0.90.12/app-dist/desktop.js:1:128270)
    at l (http://localhost:8081/assets/v0.90.12/app-dist/desktop.js:1:123972)
    at async Object.error (http://localhost:8081/assets/v0.90.12/app-dist/desktop.js:1:122702)
Stack: Error
    at Object.y [as logError] (http://localhost:8081/assets/v0.90.12/app-dist/desktop.js:1:139076)
    at http://localhost:8081/assets/v0.90.12/app-dist/desktop.js:1:79720
ERROR: delete /api/branches/:branchId threw exception: 'Can't delete root or hoisted branch/note', stack: Error: Can't delete root or hoisted branch/note
    at BBranch.deleteBranch (file:///usr/src/app/src/becca/entities/bbranch.js:135:19)
    at deleteBranch (file:///usr/src/app/src/routes/api/branches.js:152:30)
    at Function.cb (file:///usr/src/app/src/routes/routes.js:379:34)
    at Function.sqliteTransaction (/usr/src/app/node_modules/better-sqlite3/lib/methods/transaction.js:65:24)
    at Object.transactional (file:///usr/src/app/src/services/sql.js:205:52)
    at file:///usr/src/app/src/routes/routes.js:380:44
    at /usr/src/app/node_modules/cls-hooked/context.js:118:13
    at Namespace.run (/usr/src/app/node_modules/cls-hooked/context.js:97:5)
    at Namespace.runAndReturn (/usr/src/app/node_modules/cls-hooked/context.js:117:8)
    at Object.init (file:///usr/src/app/src/services/cls.js:4:22)
JS Error: 500 DELETE branches/_share_glFhxD2myVBm?taskId=no-progress-reporting - Can't delete root or hoisted branch/note
Stack: Error
    at Object.y [as logError] (http://localhost:8081/assets/v0.90.12/app-dist/desktop.js:1:139076)
    at Object.g [as throwError] (http://localhost:8081/assets/v0.90.12/app-dist/desktop.js:1:128258)
    at l (http://localhost:8081/assets/v0.90.12/app-dist/desktop.js:1:123972)
    at async Object.error (http://localhost:8081/assets/v0.90.12/app-dist/desktop.js:1:122702)
JS Error: Uncaught error: Message: 500 DELETE branches/_share_glFhxD2myVBm?taskId=no-progress-reporting - Can't delete root or hoisted branch/note, Line: undefined, Column: undefined, Error object: {}, Stack: Error: 500 DELETE branches/_share_glFhxD2myVBm?taskId=no-progress-reporting - Can't delete root or hoisted branch/note
    at Object.g [as throwError] (http://localhost:8081/assets/v0.90.12/app-dist/desktop.js:1:128270)
    at l (http://localhost:8081/assets/v0.90.12/app-dist/desktop.js:1:123972)
    at async Object.error (http://localhost:8081/assets/v0.90.12/app-dist/desktop.js:1:122702)
Stack: Error
    at Object.y [as logError] (http://localhost:8081/assets/v0.90.12/app-dist/desktop.js:1:139076)
    at http://localhost:8081/assets/v0.90.12/app-dist/desktop.js:1:79720

TriliumNext Version

latest

What operating system are you using?

Windows

What is your setup?

Local (no sync)

Operating System Version

Windows 11

Error logs

No response

@perfectra1n perfectra1n added the bug Something isn't working label Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant