-
Notifications
You must be signed in to change notification settings - Fork 832
Add API endpoint to import entries into an existing feed #3928
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
Conversation
abc3679 to
2e8f5f8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a new authenticated REST API endpoint (POST /feeds/{feedID}/entries/import) to support importing individual entries directly into an existing feed. The endpoint is designed to facilitate data migration from other feed readers (such as Tiny Tiny RSS) where entries don't originate from standard feed parsing. The implementation includes storage layer support for inserting entries with duplicate detection based on entry hash.
- New
InsertEntryForFeedstorage method that handles entry creation or update with transaction management - New
importFeedEntryAPI handler with support for custom entry metadata (published dates, status, starred state, tags, external IDs) - Route registration for the new import endpoint
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 12 comments.
| File | Description |
|---|---|
| internal/storage/entry.go | Adds InsertEntryForFeed method for inserting or updating a single entry with transaction handling and duplicate detection |
| internal/api/entry.go | Adds EntryImportRequest struct and importFeedEntry handler to process entry import requests with validation and metadata handling |
| internal/api/api.go | Registers the new /feeds/{feedID}/entries/import POST route for the import endpoint |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
fguillot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In addition to the issues reported by Copilot, it would be helpful to add an integration test to validate this endpoint and update the Go client accordingly.
|
Thanks for the review. I’ll add an integration test for this endpoint and update the Go client accordingly. I’ll also move EntryImportRequest to payload.go to match existing conventions. Regarding updateExisting, you’re right — it’s not needed in the current design. I’ll remove that argument and simplify the storage API. |
c054fc5 to
017afc0
Compare
19eaae7 to
3ae9389
Compare
|
Hi @gbcox , like you I'm migrating from ttrss. May I suggest you also create a "Show and tell" post in the discussions, for more visibility? I'm sure there are other people that will migrate in the next few weeks. I ended up writing a dirty migration script, but I would have used your tool if I had known it existed 😅 |
|
Hi @JPFrancoia, Thanks, I submitted the PR mainly because I assumed others might run into the same ttrss migration issue. If it’s accepted, adding a short Discussions post would make sense. I also have a small Python script I used that could be helpful. |
Refactor miniflux#3946 for reusing existing code. Revert not relevant miniflux#3945. Revert miniflux#3928 because I think this project doesn't need that functionality.
Reimplement miniflux#3928 my way + some refactoring. Now the endpoint references the feed by its URL, instead of id. It imports multiple entries instead of one entry.
This adds a new authenticated API endpoint that allows clients to import
entries directly into an existing feed.
The endpoint is intended to support data migration from other feed readers
(for example, Tiny Tiny RSS to Miniflux migration) where entries do not
originate from standard feed parsing.
This endpoint was tested by importing an existing Tiny Tiny RSS database
into Miniflux, covering ~2.1 million entries spanning 2003–2025. The test
included preserving entry dates and avoiding duplicate entries during import.
Checklist: