Skip to content

Conversation

@Iamrodos
Copy link
Contributor

Fixes bug where attachments were downloaded multiple times with incremented filenames (file.mov, file_1.mov, file_2.mov) when running backups without --skip-existing flag.

I should not have used the --skip-existing flag for attachments, it did not do what I thought it did.

The correct approach is to always use the manifest to guide what has already been downloaded and what now needs to be done. The manifest is now checked on every run, regardless of flags.

In making this fix, I found it challenging not having tests to ensure there was no regression. So I also added pytest with a minimal setup and isolated configuration. Created a separate test workflow to keep tests isolated from linting. This will assist when others do a PR on the attachment code.

Tests cover the key elements of the attachment logic:

  • URL extraction from issue bodies
  • Filename extraction from different URL types
  • Filename collision resolution
  • Manifest duplicate prevention

Broke the PR into two commits that handle the two activities separately.

  1. fix: Prevent duplicate attachment downloads
  2. test: Add pytest infrastructure and attachment tests

Fixes bug where attachments were downloaded multiple times with
incremented filenames (file.mov, file_1.mov, file_2.mov) when
running backups without --skip-existing flag.

I should not have used the --skip-existing flag for attachments,
it did not do what I thought it did.

The correct approach is to always use the manifest to guide what
has already been downloaded and what now needs to be done.
In making my last fix to attachments, I found it challenging not
having tests to ensure there was no regression.

Added pytest with minimal setup and isolated configuration. Created
a separate test workflow to keep tests isolated from linting.

Tests cover the key elements of the attachment logic:
- URL extraction from issue bodies
- Filename extraction from different URL types
- Filename collision resolution
- Manifest duplicate prevention
@josegonzalez josegonzalez merged commit 1750d0e into josegonzalez:master Nov 16, 2025
10 checks passed
@josegonzalez
Copy link
Owner

Thanks for the pull request!

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.

2 participants