Skip to content

[assets] 多文件上传或拖放只保留最后处理的资源 #4

Description

@jamiesun

Context Boundary

  • Repo/module: talkincode/GameKit, asset upload and drop handlers
  • Version/commit: main, 9eb811e7bc3db3193b57609425723c478e438d32
  • Runtime: browser UI; file reads complete asynchronously
  • OS/browser: not recorded; this is a source-level reproduction
  • Dependencies/config: no feature flag involved

Expectation vs. Reality

Expected: Selecting or dropping several files adds every file to the current project.

Actual: Each file.arrayBuffer() callback calls an addBytes function created from the same render. That function builds the next project from the same captured project snapshot, so each completion overwrites the previous completion; only the last processed file remains.

Reproduction Path

  1. Open the Assets pane and choose Upload.
  2. Select two or more different files at once (or drop multiple files onto the workspace).
  3. Inspect the asset list and export the source ZIP.

Minimal reproduction: invoke the same captured addBytes twice with separate files before a rerender; each result is derived from the same starting project.

Blast Radius

  • Affected users/paths: multi-select upload and multi-file drag-and-drop.
  • Frequency: every batch containing more than one file can lose earlier items.
  • Severity rationale: project assets silently go missing and are absent from exports; recommend P2.
  • Workaround: upload or drop one file at a time.

Evidence

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions