zadam / trilium

Build your personal knowledge base with Trilium Notes
GNU Affero General Public License v3.0
27.2k stars 1.9k forks source link

(Bug report) js file error in importing repacked zip #2464

Closed Nriver closed 2 years ago

Nriver commented 2 years ago

Trilium Version

0.48.9

What operating system are you using?

Other Linux

What is your setup?

Local (no sync)

Operating System Version

Manjaro

Description

I tried 0.48.9 with the zip files mentioned in #2440, another error showed up.

ERROR: Could not scan for links note e11mDP5OUR2C: Unexpected end of JSON input SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at findRelationMapLinks (/home/nate/soft/trilium/trilium-trans/trilium-linux-x64/resources/app.asar/src/services/notes.js:254:22)
    at saveLinks (/home/nate/soft/trilium/trilium-trans/trilium-linux-x64/resources/app.asar/src/services/notes.js:416:9)
    at scanForLinks (/home/nate/soft/trilium/trilium-trans/trilium-linux-x64/resources/app.asar/src/services/notes.js:665:28)
    at Function.<anonymous> (/home/nate/soft/trilium/trilium-trans/trilium-linux-x64/resources/app.asar/src/services/notes.js:128:9)
    at Function.sqliteTransaction (/home/nate/soft/trilium/trilium-trans/trilium-linux-x64/resources/app.asar/node_modules/better-sqlite3/lib/methods/transaction.js:65:24)
    at Object.transactional (/home/nate/soft/trilium/trilium-trans/trilium-linux-x64/resources/app.asar/src/services/sql.js:242:52)
    at Object.createNewNote (/home/nate/soft/trilium/trilium-trans/trilium-linux-x64/resources/app.asar/src/services/notes.js:109:16)
    at saveDirectory (/home/nate/soft/trilium/trilium-trans/trilium-linux-x64/resources/app.asar/src/services/import/zip.js:180:31)
    at /home/nate/soft/trilium/trilium-trans/trilium-linux-x64/resources/app.asar/src/services/import/zip.js:469:13

After the fix, all the text notes are imported correctly. However, I find the notes with js file in it got broken.

Namely, the "weight tracker" note and the "statistics" note

ksnip_20211224-135458

ksnip_20211224-135512

zadam commented 2 years ago

Hi, thanks for reporting, found the bug and fixed it.