fix: Export Dataset button reports "undefined files" and does not export#250
Open
lstein wants to merge 1 commit into
Open
fix: Export Dataset button reports "undefined files" and does not export#250lstein wants to merge 1 commit into
lstein wants to merge 1 commit into
Conversation
… files
Three bugs combined to break the Export Dataset feature:
1. check_album_lock() was called with no argument in export_dataset, which
blocks all exports whenever PHOTOMAP_ALBUM_LOCKED is set -- even for
albums that are in the allowed list. Export is not a destructive
album-management operation; the correct per-album lock check is already
done inside validate_album_exists() which is called immediately after.
2. An overly-restrictive is_within_base_dir check required the export
destination to be inside Path.home(). Users exporting to external drives
or network mounts (e.g. /Volumes/..., /mnt/...) received a 400 error
silently. Source-path security is handled by validate_image_access();
no restriction on the destination is necessary.
3. The frontend export handler did not check response.ok before accessing
data.exported. Any server-side error returned {"detail": "..."} without
an exported field, causing the dialog to read "Exported undefined files"
with no indication of what went wrong.
Fixes #245
Co-authored-by: Lincoln Stein <lstein@users.noreply.github.com>
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.
Fixes #245
Three bugs combined to break the Export Dataset button:
check_album_lock()was called with no argument inexport_dataset, blocking all exports whenPHOTOMAP_ALBUM_LOCKEDis set.response.ok, causing any server error to silently show "Exported undefined files".Generated with Claude Code