Skip to content

Fix backup export abort on NULL attach_file_name - #331

Open
Flerpharos wants to merge 1 commit into
mainfrom
fix/324-backup-null-attach-filename
Open

Fix backup export abort on NULL attach_file_name#331
Flerpharos wants to merge 1 commit into
mainfrom
fix/324-backup-null-attach-filename

Conversation

@Flerpharos

Copy link
Copy Markdown
Collaborator

Fixes #324

Summary

_backup_tree called Path(part['attach_file_name']).name unconditionally for attachment parts (part_type == 2). A backup db.sqlite3 whose attachment entry_part has attach_file_name NULL made Path(None) raise TypeError, aborting the entire backup-source export instead of degrading gracefully for that one attachment. Now falls back to f"attachment_{part['id']}" when the column is NULL.

Test plan

  • uv run pytest --ignore=tests/test_integration.py -q (432 passed)
  • uv run ruff check .
  • New test test_backup_tree_generates_name_for_null_attach_file_name covers a NULL attach_file_name end to end (export tree build + write), asserting the generated filename and metadata.

…p export

_backup_tree called Path(part['attach_file_name']).name unconditionally
for attachment parts, so a NULL attach_file_name in the backup database
raised TypeError and aborted the entire backup-source export. Fall back
to a generated name based on the part id when the column is NULL.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Backup export aborts on a NULL attach_file_name

1 participant