[PR #3142] [MERGED] let import continue when malformed URLs are encountered #5516

Closed
opened 2025-10-01 17:12:27 -05:00 by giteasync · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/TriliumNext/Trilium/pull/3142
Author: @spasche
Created: 9/18/2022
Status: Merged
Merged: 9/19/2022
Merged by: @zadam

Base: masterHead: zip-import-skip-bad-url


📝 Commits (1)

  • fc69f3b let import continue when malformed URLs are encountered

📊 Changes

1 file changed (+12 additions, -2 deletions)

View changed files

📝 src/services/import/zip.js (+12 -2)

📄 Description

Hi,

I recently started using Trilium and wanted to import a rather large set of HTML files.

Some of the files contain invalid links (e.g. http://example.com/${path}).

In such case, the import gets stuck with the "Import status" dialog not making any progress.
In the server logs, an exception is thrown:

URIError: URI malformed
    at decodeURIComponent (<anonymous>)
     at /usr/src/app/src/services/import/zip.js:307:23
     at String.replace (<anonymous>)
     at saveNote (/usr/src/app/src/services/import/zip.js:306:31)
     at /usr/src/app/src/services/import/zip.js:491:13
     at runMicrotasks (<anonymous>)
     at processTicksAndRejections (node:internal/process/task_queues:96:5)

Nothing indicates the malformed URL or which file is causing the issue.

This PR keeps invalid URLs in the imported notes (with some logging).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/TriliumNext/Trilium/pull/3142 **Author:** [@spasche](https://github.com/spasche) **Created:** 9/18/2022 **Status:** ✅ Merged **Merged:** 9/19/2022 **Merged by:** [@zadam](https://github.com/zadam) **Base:** `master` ← **Head:** `zip-import-skip-bad-url` --- ### 📝 Commits (1) - [`fc69f3b`](https://github.com/TriliumNext/Trilium/commit/fc69f3b8f3a538e5b8d89c197081a28f6e501b4f) let import continue when malformed URLs are encountered ### 📊 Changes **1 file changed** (+12 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/services/import/zip.js` (+12 -2) </details> ### 📄 Description Hi, I recently started using Trilium and wanted to import a rather large set of HTML files. Some of the files contain invalid links (e.g. `http://example.com/${path}`). In such case, the import gets stuck with the "Import status" dialog not making any progress. In the server logs, an exception is thrown: ``` URIError: URI malformed at decodeURIComponent (<anonymous>) at /usr/src/app/src/services/import/zip.js:307:23 at String.replace (<anonymous>) at saveNote (/usr/src/app/src/services/import/zip.js:306:31) at /usr/src/app/src/services/import/zip.js:491:13 at runMicrotasks (<anonymous>) at processTicksAndRejections (node:internal/process/task_queues:96:5) ``` Nothing indicates the malformed URL or which file is causing the issue. This PR keeps invalid URLs in the imported notes (with some logging). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
giteasync added the
pull-request
label 2025-10-01 17:12:27 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: TriliumNext/Trilium#5516
No description provided.