Skip to content

Fix: never overwrite an existing icon on upload - #499

Merged
SandObserver merged 1 commit into
mainfrom
fix/icon-upload-no-overwrite
Oct 18, 2026
Merged

SandObserver merged 1 commit into
mainfrom
fix/icon-upload-no-overwrite

Conversation

@SandObserver

Copy link
Copy Markdown
Owner

Summary

  • Fall back to a random 12-hex-digit suffix in safeIconName when the name and all 998 numbered copies exist.
  • Write icon uploads with the wx flag, so an existing file is never truncated.

Testing
All green. Added 1 test for the exhausted-suffix case.

Changelog

Fixed

  • Stop an icon upload from overwriting an existing icon when many share its name.

Checklist

  • Stays within the project constraints: one container, no runtime dependencies, no build step (see CONTRIBUTING.md).
  • Tests added or updated for new logic, and the full suite, lint, and typechecks pass.
  • Docs updated if behavior or configuration changed.

safeIconName stopped at the -999 suffix without checking it, so once a
name had 999 numbered copies the next upload overwrote the last one.
It now falls back to a random suffix, and the upload writes with the
exclusive-create flag.
@SandObserver SandObserver added the bug Something isn't working label Oct 18, 2026
@SandObserver
SandObserver merged commit 27ba84d into main Oct 18, 2026
6 checks passed
@SandObserver
SandObserver deleted the fix/icon-upload-no-overwrite branch October 18, 2026 22:44
stackyard-release Bot pushed a commit that referenced this pull request Oct 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant