Skip to content
New issue

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

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

Already on GitHub? # to your account

(Bug report) Libraries in Excalidraw are broken #772

Closed
CobriMediaJulien opened this issue Dec 14, 2024 · 5 comments
Closed

(Bug report) Libraries in Excalidraw are broken #772

CobriMediaJulien opened this issue Dec 14, 2024 · 5 comments

Comments

@CobriMediaJulien
Copy link
Contributor

Description

In the file canvas.js the following part of the code is broken:

'''
Promise.all(
(await note.getAttachmentsByRole('canvasLibraryItem'))
.map(attachment => attachment.getBlob())
).then(blobs => {
if (note.noteId !== this.currentNoteId) {
// current note changed in the course of the async operation
return;
}
'''

image

the code return empty blob content.

TriliumNext Version

0.90.12

What operating system are you using?

Windows

What is your setup?

Local + server sync

Operating System Version

Win 10

Error logs

No response

@CobriMediaJulien
Copy link
Contributor Author

For reference:

Zadam integrated libraries allrdy:

zadam/trilium@f37dc66

But the feature doesn´t work anymore with triliumnext. I´m also happy for more advice where to search. Maybe i can debug myself with some help.

@CobriMediaJulien
Copy link
Contributor Author

Just an idea:

instead of saving the library in the attachments, how about a own hidden notebook structure and the user can just add the json content there. so the user could manage his library. So this could be rather a feature improvement instead bug fixing.

@CobriMediaJulien
Copy link
Contributor Author

CobriMediaJulien commented Dec 14, 2024

Documentation for fix, until I handle my code better. It's chaos right now:

change in sattachments.ts:

  hasStringContent() {
        const isString = utils.isStringNote(undefined, this.mime);
        console.log(`hasStringContent in sattachment called for MIME: ${this.mime}, Result: ${isString}`);
        return isString;
    }

undefined was null before.

and in ultis.ts:

function isStringNote(type: string | undefined, mime: string): boolean { ..]

null was replaced with undefined too. then it works like in zadams integration

@eliandoran
Copy link
Contributor

Reopening until the PR is merged.

@eliandoran eliandoran reopened this Dec 16, 2024
@eliandoran eliandoran added the bug label Dec 18, 2024
@eliandoran
Copy link
Contributor

Done in #787 .

@eliandoran eliandoran changed the title (Bug report) Librarys in Excalidraw are broken (Bug report) Libraries in Excalidraw are broken Dec 18, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants