Skip to content

feat: skip upload and backup for zero-byte files and update validation logic#401

Merged
egalvis27 merged 1 commit into
mainfrom
feat/do-not-upload-zero-bytes-files-on-backups
Jul 1, 2026
Merged

feat: skip upload and backup for zero-byte files and update validation logic#401
egalvis27 merged 1 commit into
mainfrom
feat/do-not-upload-zero-bytes-files-on-backups

Conversation

@egalvis27

Copy link
Copy Markdown

What is Changed / Added


  • I added a centralized empty-file validation rule in the upload size validator, with an opt-in flag so existing flows keep their current behavior unless they explicitly disable empty files.
  • I introduced a new EMPTY_FILE validation reason and used it in backup upload/update flows only, so zero-byte files are skipped before any content upload attempt.
  • I updated backup upload logic to short-circuit cleanly for empty files, avoiding both content upload and metadata creation for new backup entries.
  • I updated backup update logic to short-circuit cleanly for empty files as well, avoiding unnecessary override calls for existing entries.
  • I kept max-size rejection behavior unchanged for real size-limit cases, and made sure empty-file skips do not trigger max-size rejection tracking/modal behavior.

Why

  • We were seeing inconsistent failures when the client tried to upload zero-byte files during backup (for example, server 500 in some environments and Invalid size in others).
  • Even though the backup could continue for other files, these attempts generated noisy error logs and, in some cases, unnecessary retry behavior.
  • By handling zero-byte files earlier and consistently, we prevent avoidable upload calls, reduce retry/log noise, and make backup behavior more predictable.
  • Centralizing this in the validator keeps the rule in one place and avoids duplicating ad-hoc checks across multiple upload paths.

@sonarqubecloud

Copy link
Copy Markdown

@egalvis27 egalvis27 merged commit 2e939f1 into main Jul 1, 2026
11 checks passed
@egalvis27 egalvis27 deleted the feat/do-not-upload-zero-bytes-files-on-backups branch July 1, 2026 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants