Skip to content

fix: accept single-pet folder zip uploads#495

Closed
henryjing96 wants to merge 1 commit into
mainfrom
henry/fix-zip-upload
Closed

fix: accept single-pet folder zip uploads#495
henryjing96 wants to merge 1 commit into
mainfrom
henry/fix-zip-upload

Conversation

@henryjing96

Copy link
Copy Markdown
Collaborator

Summary

  • Support ZIP uploads where pet.json and spritesheet.webp/png are inside a single top-level pet folder.
  • Prefer root-level pet files when both root and nested pet structures exist.
  • Ignore macOS/system metadata files during ZIP classification.

Validation

  • bun test src/lib/pet-zip.test.ts
  • bun run check
  • TELEMETRY_RATELIMIT_SECRET=mock-build-secret bun --env-file=.env.mock run build

Support ZIP uploads where pet.json and spritesheet.webp/png are inside a single top-level pet folder. Prefer root-level pet files when both root and nested pet structures exist, and ignore macOS/system metadata files during ZIP classification.

Add regression coverage for root ZIPs, nested single-pet ZIPs, hidden system files, and multi-pet bundle detection.
@github-actions

Copy link
Copy Markdown

[important] src/lib/pet-zip.ts:65-71 misclassifies multi-pet archives when only one nested pet has a spritesheet. For example, boba/pet.json, boba/spritesheet.webp, and kebo/pet.json returns kind: "pet" because completeNestedCandidates.length === 1 runs before the later candidates.length > 1 bundle check. The submit form then normalizes and uploads only boba, silently ignoring the extra pet.json. That can turn an incomplete all-pets bundle into a single-pet submission instead of showing the bundle/error path. Consider checking for multiple non-root pet.json candidates before accepting the single complete nested candidate, and add a regression test for this partial-bundle case.

@henryjing96

Copy link
Copy Markdown
Collaborator Author

no need to support this feature

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