Skip to content

fix: a form's tmp/ uploads aren't orphans - #25

Merged
oxyc merged 1 commit into
mainfrom
gf-tmp-uploads
Dec 1, 2026
Merged

oxyc merged 1 commit into
mainfrom
gf-tmp-uploads

Conversation

@oxyc

@oxyc oxyc commented Dec 1, 2026

Copy link
Copy Markdown
Member

Gravity Forms keeps uploads of submissions never finished (a visitor picks a file in the multi-file uploader, then swaps or abandons it) in gravity_forms/<form>-<hash>/tmp/. It deletes them, once past 2 days (30 with Save and Continue), only when that form is next submitted. The orphan-uploads check scanned tmp/ too and called those files uploads that "outlived their entries", which they never had.

Now:

  • tmp/ files under 30 days old are counted in a note (tmp_pending), not flagged
  • older ones get their own review flag, retention:abandoned-uploads:<blog>:…: uploads of submissions never finished, on a form nobody has submitted since
  • real orphans keep their flag and ID, so accepted ones stay accepted

TestRetentionAbandonedTmpUploads covers the note, the new flag and the orphan flag beside it; go test ./..., go vet and php -l collector.php pass.

🤖 Generated with Claude Code

Gravity Forms keeps uploads of submissions never finished (a file picked, then swapped) in the form's tmp/ folder and deletes them, past 2 days (30 with Save and Continue), only on that form's next submission. The orphan check read them as files that outlived their entry. Under 30 days they're now a note; older ones get their own flag: abandoned uploads on a form nobody has submitted since.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@oxyc
oxyc merged commit 9c87d05 into main Dec 1, 2026
2 checks passed
@oxyc
oxyc deleted the gf-tmp-uploads branch December 1, 2026 12:30
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.

1 participant