Skip to content

Conversation

@bvdwalt
Copy link

@bvdwalt bvdwalt commented Nov 10, 2025

Description

Adds support for specifying a Linkwarden collection ID when saving entries. This allows users to organize their saved entries into specific collections in Linkwarden.

Motivation

Currently, the Linkwarden integration saves entries without specifying a collection. This enhancement allows users to automatically save entries to a specific collection by providing its ID in the integration settings.

Changes

  • Added linkwarden_collection_id field to the integrations database table

    • I went with adding the collection ID instead of the name, since specifying the name caused duplicate collections to be created on Linkwarden. You can also rename the collection on Linkwarden which would then break this integration, hence using the id is safer from miniflux's side.
  • Updated the Linkwarden client to accept an optional collection ID parameter

  • Added collection ID input field to the integration settings UI

  • Updated all translation files with the new label

  • Improved error handling by logging the response body on errors

Testing

  • Tested with local Linkwarden instance
  • Verified that entries are saved to the specified collection
  • Confirmed that the field is optional (entries save to default collection when not specified)
  • Tested database migration
Miniflux Settings integrations page with addition Miniflux urls appearing in Linkwarden

Breaking Changes

None. This is a backward-compatible addition.

Related Issues

#3577

Have you followed these guidelines?

Copy link
Member

@fguillot fguillot left a comment

Choose a reason for hiding this comment

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

There is a panic when the collection ID is nil:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xa5deb0]

goroutine 108 [running]:
miniflux.app/v2/internal/integration.SendEntry(0xc0008ce8c0, 0xc000916008)
        /home/fred/repos/miniflux/v2/internal/integration/integration.go:278 +0x2f10
created by miniflux.app/v2/internal/ui.(*handler).saveEntry in goroutine 64
        /home/fred/repos/miniflux/v2/internal/ui/entry_save.go:38 +0x205
exit status 2

@bvdwalt
Copy link
Author

bvdwalt commented Nov 12, 2025

There is a panic when the collection ID is nil:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xa5deb0]

goroutine 108 [running]:
miniflux.app/v2/internal/integration.SendEntry(0xc0008ce8c0, 0xc000916008)
        /home/fred/repos/miniflux/v2/internal/integration/integration.go:278 +0x2f10
created by miniflux.app/v2/internal/ui.(*handler).saveEntry in goroutine 64
        /home/fred/repos/miniflux/v2/internal/ui/entry_save.go:38 +0x205
exit status 2

Thanks for flagging this, turns out it was just for the logging, I have fixed that now.

@bvdwalt bvdwalt requested a review from fguillot November 12, 2025 10:24
@bvdwalt bvdwalt force-pushed the feat/linkwarden-collection-support branch from 9eeaad2 to cd052a0 Compare November 13, 2025 14:42
@fguillot
Copy link
Member

I can see a 400 response when the collection ID is null which is the default:

level=ERROR msg="Unable to send entry to Linkwarden" user_id=1 entry_id=40 entry_url=https://www.example.org/ collection_id=<nil> error="linkwarden: unable to create link: status=400 body={\"response\":\"Error: Expected number, received null [collection, id]\"}"

@bvdwalt
Copy link
Author

bvdwalt commented Nov 15, 2025

I can see a 400 response when the collection ID is null which is the default:

level=ERROR msg="Unable to send entry to Linkwarden" user_id=1 entry_id=40 entry_url=https://www.example.org/ collection_id=<nil> error="linkwarden: unable to create link: status=400 body={\"response\":\"Error: Expected number, received null [collection, id]\"}"

I implemented the fix for this along with some tests which caught the error and shows that it works correctly now.

@bvdwalt bvdwalt force-pushed the feat/linkwarden-collection-support branch from 556ca1d to ea86da2 Compare November 15, 2025 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants