Add collection download as JSON endpoint#4509
Open
brandonjackson wants to merge 1 commit intomainfrom
Open
Conversation
Add a Download button to each collection row in the settings table, allowing users to download all collection items as a JSON file. - Add GET /download/collection route with browser session auth - Add download_collection_json/2 to DownloadsController with chunked streaming to handle large collections efficiently - Add Download link in CollectionsComponent actions slot - Add tests for success, empty, unauthorized, not found, and project mismatch scenarios https://claude.ai/code/session_0133om1iWqftcidvyYshXDFQ
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4509 +/- ##
=======================================
Coverage 89.55% 89.55%
=======================================
Files 425 425
Lines 20295 20320 +25
=======================================
+ Hits 18175 18198 +23
- Misses 2120 2122 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
midigofrank
requested changes
Mar 10, 2026
Collaborator
midigofrank
left a comment
There was a problem hiding this comment.
@brandonjackson , this is definitely in the right direction. We can polish it a little bit to reduce duplication of the streaming logic and also to reuse the auth logic used by other actions. 🤔 I'd be curious to see how the app handles a 50mb collection
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds a new endpoint to download collection items as JSON files. Users can now export collection data from a project via
GET /download/collectionwith query parameters forproject_idand collectionname.The implementation includes:
download_collection_json/2controller action with proper authorization checksstream_collection_items/2) that efficiently processes large collections in batches of 500 itemsValidation steps
[])mix test test/lightning_web/controllers/download_controller_test.exsAdditional notes for the reviewer
ProjectUsersandPermissions.can/4to ensure only project members can downloadcollection.project_id == project.idPlug.Conn.chunk/2to handle large datasets efficientlydownload_project_yamlactionAI Usage
Pre-submission checklist
/reviewwith Claude Code):owner,:admin,:editor,:viewer)https://claude.ai/code/session_0133om1iWqftcidvyYshXDFQ