Skip to content

Fix division by zero in delete-disconnected-fs-submissions#7746

Open
heathdutton wants to merge 2 commits into
freedomofpress:developfrom
heathdutton:7201-fix-submissions-division-by-zero
Open

Fix division by zero in delete-disconnected-fs-submissions#7746
heathdutton wants to merge 2 commits into
freedomofpress:developfrom
heathdutton:7201-fix-submissions-division-by-zero

Conversation

@heathdutton

Copy link
Copy Markdown
Contributor

Fixes #7201

When deleting disconnected filesystem submissions, if a file has zero bytes, rate becomes 0 after the first deletion. On subsequent iterations, the ETA calculation filesize / rate causes a ZeroDivisionError.

This adds a guard to skip the ETA calculation when rate is zero.

Test plan

  1. Create a disconnected empty file in the store
  2. Run manage.py delete-disconnected-fs-submissions --force
  3. Verify no ZeroDivisionError occurs

Checklist

This change accounts for:

  • any required additional documentation
  • any necessary AppArmor changes (added or removed application files)
  • any impact on new SecureDrop installs and upgrades
  • our dependency update policy

@heathdutton heathdutton requested a review from a team as a code owner December 31, 2025 17:37
@legoktm

legoktm commented Jan 6, 2026

Copy link
Copy Markdown
Member

@heathdutton hi, thanks for submitting all these PRs! It'll take us a bit of time to get to reviewing them as our main priority is on the SecureDrop Workstation side of things right now. And you don't need to keep updating them, if there are conflicts we'll rebase when needed.

Also please let us know if you used any AI/LLM tools when creating these so we can review accordingly.

@zenmonkeykstop zenmonkeykstop moved this to Next sprint candidates in SecureDrop Jan 20, 2026
@nathandyer nathandyer moved this from Next sprint candidates to Backlog in SecureDrop Jan 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

division by zero in manage.py delete-disconnected-fs-submissions

4 participants