Skip to content

[7231] Validate uploading files existence#4914

Open
jvega190 wants to merge 8 commits into
craftercms:developfrom
jvega190:enhancement/7231
Open

[7231] Validate uploading files existence#4914
jvega190 wants to merge 8 commits into
craftercms:developfrom
jvega190:enhancement/7231

Conversation

@jvega190

@jvega190 jvega190 commented Jul 9, 2026

Copy link
Copy Markdown
Member

craftercms/craftercms#7231

Summary by CodeRabbit

  • New Features

    • Added remote path existence checking to site-policy uploads, triggering an overwrite-required state when the target file already exists.
    • Introduced a “confirm overwrite” action in the dashboard, alongside existing validate/retry flows.
    • Extended dashboard and upload dialog messaging to support overwrite prompts and related button labels.
  • Bug Fixes

    • Improved completion/invalid counting to account for overwrite-required files.
    • Refined confirmation handling so overwrite decisions reliably clear warnings and restart uploads, including better error reporting.

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@jvega190, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 37 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 475f8f22-6f56-44d5-87f4-29dd9da1fbb1

📥 Commits

Reviewing files that changed from the base of the PR and between 3f06573 and ea4fb04.

📒 Files selected for processing (3)
  • ui/app/src/components/UppyDashboard/UppyDashboard.tsx
  • ui/uppy/src/plugins/Dashboard.jsx
  • ui/uppy/src/plugins/locale.js

Walkthrough

Adds overwrite confirmation to upload flows by checking remote path existence before upload. Single-file upload now branches between policy confirmation, overwrite confirmation, and error handling. The Uppy dashboard plugin, UI, locale types, and file item actions were updated to surface overwrite-required state and actions. A placeholder button was removed from the upload dialog.

Changes

Overwrite confirmation for uploads

Layer / File(s) Summary
SingleFileUpload overwrite/confirm flow
ui/app/src/components/SingleFileUpload/SingleFileUpload.tsx
Adds checkPathExistence import, overwrite messaging, discriminated confirm.type state (policy/overwrite/error), new confirmUpload/checkExistenceAndUpload helpers, and updated confirm/cancel/dialog handlers.
UppyDashboard checkPathExistence wiring and messages
ui/app/src/components/UppyDashboard/UppyDashboard.tsx
Wires checkPathExistence into the Uppy Dashboard plugin options; adds overwrite-related i18n messages and locale/external message callbacks.
Dashboard plugin checkPathAndUpload and validation logic
ui/uppy/src/plugins/Dashboard.jsx, ui/uppy/types/generatedLocale.d.ts
Adds checkPathAndUpload, reworks validateFilesPolicy to coordinate pending existence checks, updates confirmOverwrite/confirmAll, treats overwriteRequired as invalid, and adds confirmOverwrite to the DashboardLocale type.
FileItem/FileList/Dashboard UI props and overwrite warning
ui/uppy/src/components/Dashboard.jsx, ui/uppy/src/components/FileList.jsx, ui/uppy/src/components/FileItem/index.jsx, ui/uppy/src/components/FileItem/Buttons/index.jsx, ui/uppy/src/components/FileItem/FileInfo/index.jsx
Propagates confirmOverwrite through the component tree, adds a generic confirm icon for validate/overwrite actions, and renders a new overwrite warning in FileInfo.

UploadDialogContainer cleanup

Layer / File(s) Summary
Remove unused test Button placeholder
ui/app/src/components/UploadDialog/UploadDialogContainer.tsx
Removes the unused Button import and hidden placeholder <Button> element from the rendered dialog.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

  • craftercms/studio-ui#4826: Both PRs modify the same ui/app/src/components/SingleFileUpload/SingleFileUpload.tsx component and its upload-trigger flow.

Suggested reviewers: rart

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: validating file existence before upload.
Description check ✅ Passed The description satisfies the template by providing the ticket reference for the PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
ui/uppy/src/plugins/Dashboard.jsx (1)

343-378: 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Confirm policy-corrected uploads as pending
confirmAll should mark the dashboard as pending when an allowed file starts uploading. The allowed branch calls checkPathAndUpload(...) without an onUploadStarted callback, so onPendingChanges(true) never fires for that path. validateAndRetry has the same gap if single-file retries are meant to update pending state too. Mirror the validateFilesPolicy callback/pending-check flow here.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ui/uppy/src/plugins/Dashboard.jsx` around lines 343 - 378, confirmAll in
Dashboard.jsx does not mark policy-corrected allowed uploads as pending because
the allowed branch calls checkPathAndUpload without any upload-start callback,
so onPendingChanges(true) is never triggered. Update confirmAll to mirror the
validateFilesPolicy flow by passing an onUploadStarted handler into
checkPathAndUpload for the allowed-file path, and review validateAndRetry so its
retry path also updates pending state consistently when an upload starts.
🧹 Nitpick comments (1)
ui/uppy/src/components/FileItem/Buttons/index.jsx (1)

85-85: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Simplify the click handler.

onClick={() => onClick()} wraps the callback unnecessarily. Use onClick={onClick} directly.

♻️ Proposed refactor
-		onClick={() => onClick()}
+		onClick={onClick}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ui/uppy/src/components/FileItem/Buttons/index.jsx` at line 85, The click
handler in the Buttons component is wrapped unnecessarily with an arrow
function, causing avoidable indirection. Update the onClick prop in the FileItem
Buttons JSX to pass the existing onClick callback directly instead of wrapping
it, and keep the same handler reference used in this component.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@ui/uppy/src/components/FileItem/Buttons/index.jsx`:
- Around line 128-133: The two ConfirmActionIcon render branches in
Buttons/index.jsx are not mutually exclusive, so validateAndRetry and
confirmOverwrite can both appear when overwriteRequired is true and
suggestedName is still present. Update the conditional rendering around the
file.meta.validating checks so the overwrite flow takes priority, for example by
preventing the validate-and-retry branch from rendering when
file.meta.overwriteRequired is set, while keeping confirmOverwrite tied to
overwriteRequired.

In `@ui/uppy/src/components/FileItem/FileInfo/index.jsx`:
- Around line 96-107: The refactored warning icon in warningIcon() is missing
the data-ga-event-* tracking attributes that the inline SVG still has in
renderPolicyWarning(). Update warningIcon() to include the same
data-ga-event-category, data-ga-event-action, and data-ga-event-label attributes
so both branches preserve analytics behavior.

---

Outside diff comments:
In `@ui/uppy/src/plugins/Dashboard.jsx`:
- Around line 343-378: confirmAll in Dashboard.jsx does not mark
policy-corrected allowed uploads as pending because the allowed branch calls
checkPathAndUpload without any upload-start callback, so onPendingChanges(true)
is never triggered. Update confirmAll to mirror the validateFilesPolicy flow by
passing an onUploadStarted handler into checkPathAndUpload for the allowed-file
path, and review validateAndRetry so its retry path also updates pending state
consistently when an upload starts.

---

Nitpick comments:
In `@ui/uppy/src/components/FileItem/Buttons/index.jsx`:
- Line 85: The click handler in the Buttons component is wrapped unnecessarily
with an arrow function, causing avoidable indirection. Update the onClick prop
in the FileItem Buttons JSX to pass the existing onClick callback directly
instead of wrapping it, and keep the same handler reference used in this
component.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 0c9a6fa6-03bf-4a5d-950a-9ba371378f79

📥 Commits

Reviewing files that changed from the base of the PR and between 7d8ec52 and 0a2fe05.

📒 Files selected for processing (10)
  • ui/app/src/components/SingleFileUpload/SingleFileUpload.tsx
  • ui/app/src/components/UploadDialog/UploadDialogContainer.tsx
  • ui/app/src/components/UppyDashboard/UppyDashboard.tsx
  • ui/uppy/src/components/Dashboard.jsx
  • ui/uppy/src/components/FileItem/Buttons/index.jsx
  • ui/uppy/src/components/FileItem/FileInfo/index.jsx
  • ui/uppy/src/components/FileItem/index.jsx
  • ui/uppy/src/components/FileList.jsx
  • ui/uppy/src/plugins/Dashboard.jsx
  • ui/uppy/types/generatedLocale.d.ts

Comment thread ui/uppy/src/components/FileItem/Buttons/index.jsx Outdated
Comment thread ui/uppy/src/components/FileItem/FileInfo/index.jsx
@jvega190

jvega190 commented Jul 9, 2026

Copy link
Copy Markdown
Member Author

Outside diff range comment addressed

@jvega190

jvega190 commented Jul 9, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai can you check if everything looks good? Please give it a final review before I hand over for human review

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
gh pr view 4914 --repo craftercms/studio-ui --json title,body,files,commits,additions,deletions,changedFiles | head -c 3000
echo "----DIFF----"
gh pr diff 4914 --repo craftercms/studio-ui > /tmp/pr.diff
wc -l /tmp/pr.diff

Length of output: 3412


🏁 Script executed:

#!/bin/bash
set -euo pipefail
cat -n /tmp/pr.diff

Length of output: 26225


🏁 Script executed:

#!/bin/bash
set -euo pipefail
rg -n 'checkPathExistence' -C5 ui/app/src/services/content.ts
echo "---preact check---"
head -30 ui/uppy/src/components/FileItem/FileInfo/index.jsx
echo "---package.json check for preact---"
rg -n '"preact"|"react"' ui/uppy/package.json

Length of output: 1803


@jvega190 Done with a final pass over the full diff before you hand it off. Overall the implementation is solid and consistent — the overwrite-confirmation flow is wired cleanly through UppyDashboard.tsxDashboard.jsx plugin → FileItem/Buttons/FileInfo, translations are in place, and the SingleFileUpload.tsx refactor (discriminated confirm.type union) is a nice cleanup. The ConfirmActionIcon/warningIcon extractions in the uppy package are good DRY improvements too.

A few things worth a look before human review:

  1. Silent overwrite on existence-check error (bulk upload) — In ui/uppy/src/plugins/Dashboard.jsx, checkPathAndUpload's error handler calls startUpload() unconditionally (Line ~428-430), meaning if checkPathExistence fails (network/permissions error), the file is uploaded anyway, potentially overwriting an existing file without confirmation. This is inconsistent with SingleFileUpload.tsx, where the equivalent error path shows a pushErrorDialog instead of proceeding. Worth aligning behavior (e.g., surface an error/notification and block the upload rather than assuming "does not exist").

  2. Potential premature finalizeExistenceChecks() calls — In validateFilesPolicy, pendingExistenceChecks is incremented/decremented per file inside the response.forEach loop. If checkPathExistence ever emits synchronously (e.g., in tests, or via caching), the counter could hit 0 mid-loop and call finalizeExistenceChecks() before all files in the batch are processed, causing multiple/partial onPendingChanges/setPluginState calls. Safe today because the real HTTP call is async, but a bit fragile — consider incrementing the counter for the whole batch upfront before iterating.

  3. Possible double onPendingChanges(true) in confirmAll — the callback path (via checkPathAndUpload's onUploadStarted) calls this.opts.onPendingChanges(true) directly, and then the code after the forEach also conditionally calls it again if uploading is true. Given the callback is async, uploading may not be true yet when the post-loop check runs, so behavior here is a bit racy/redundant. Not breaking, but worth a quick look.

  4. No new/updated tests accompany this logic despite the "High" review-effort areas (Dashboard.jsx plugin, SingleFileUpload.tsx). Given the async overwrite-confirmation flow (bulk and single), some coverage for the "exists → confirm → retry" and "confirm cancel" paths would help guard future regressions.

Nothing here is blocking — the core feature is well-implemented and consistent across bulk/single upload flows. These are refinement suggestions for you or the human reviewer to weigh in on.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
ui/uppy/src/plugins/Dashboard.jsx (1)

202-204: 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Silent overwrite on existence-check failure.

When checkPathExistence errors, the handler calls startUpload(), so a failed check silently proceeds with the upload and can overwrite an existing file without user confirmation. This diverges from the single-file flow, which surfaces an error instead of continuing. Consider marking the file invalid (or routing to an error state) on error rather than uploading.

Want me to draft an error-handling path that mirrors the single-file flow (flag the file / surface an error instead of uploading)?

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ui/uppy/src/plugins/Dashboard.jsx` around lines 202 - 204, The
`checkPathExistence` error handler in `Dashboard.jsx` is incorrectly falling
back to `startUpload()`, which lets uploads continue after a failed existence
check. Update the `error` callback in that existence-check flow to route the
file into an error/invalid state instead of starting the upload, mirroring the
single-file handling path so the user is notified and the file is not
overwritten silently.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@ui/uppy/src/plugins/Dashboard.jsx`:
- Around line 202-204: The `checkPathExistence` error handler in `Dashboard.jsx`
is incorrectly falling back to `startUpload()`, which lets uploads continue
after a failed existence check. Update the `error` callback in that
existence-check flow to route the file into an error/invalid state instead of
starting the upload, mirroring the single-file handling path so the user is
notified and the file is not overwritten silently.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ae60d3d3-5ab6-42ea-95aa-069778ad9d20

📥 Commits

Reviewing files that changed from the base of the PR and between 0a2fe05 and 802b887.

📒 Files selected for processing (3)
  • ui/uppy/src/components/FileItem/Buttons/index.jsx
  • ui/uppy/src/components/FileItem/FileInfo/index.jsx
  • ui/uppy/src/plugins/Dashboard.jsx
🚧 Files skipped from review as they are similar to previous changes (2)
  • ui/uppy/src/components/FileItem/Buttons/index.jsx
  • ui/uppy/src/components/FileItem/FileInfo/index.jsx

…mplementing onPathExistenceError callback and refining path existence checks during uploads.
@jvega190

jvega190 commented Jul 9, 2026

Copy link
Copy Markdown
Member Author

Outside diff range comments addressed

@jvega190

jvega190 commented Jul 9, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai can you check if everything looks good? Please give it a final review before I hand over for human review

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
gh pr view 4914 --repo craftercms/studio-ui --json commits -q '.commits[-6:] | .[] | .oid + " " + .messageHeadline'
echo "----"
gh pr diff 4914 --repo craftercms/studio-ui > /tmp/pr.diff
wc -l /tmp/pr.diff

Length of output: 999


🏁 Script executed:

#!/bin/bash
set -euo pipefail
rg -n 'checkPathAndUpload|finalizeExistenceChecks|pendingExistenceChecks|confirmAll|onPendingChanges' -A6 ui/uppy/src/plugins/Dashboard.jsx | head -300

Length of output: 4188


🏁 Script executed:

#!/bin/bash
set -euo pipefail
sed -n '170,225p' ui/uppy/src/plugins/Dashboard.jsx
echo "---confirmAll full---"
sed -n '362,412p' ui/uppy/src/plugins/Dashboard.jsx

Length of output: 3251


All three concerns from the earlier review appear addressed now:

  1. Silent overwrite on existence-check errorcheckPathAndUpload's error handler no longer calls startUpload(). It now marks the file as invalid (allowed: false), attaches an error message, calls this.opts.onPathExistenceError?.(err), and completes without uploading — consistent with the SingleFileUpload.tsx error-dialog behavior.
  2. Premature finalizeExistenceChecks()pendingExistenceChecks is now computed upfront via response.filter(...).length before the forEach loop runs, so the counter can no longer hit zero mid-loop.
  3. Double onPendingChanges(true) in confirmAll — the counter-guarded pattern (pendingPathChecks) is now applied consistently, and both the callback path and the post-loop path are gated by if (pendingPathChecks === 0), so it should not double-fire in the async case.

One remaining lighter-weight item: no new/updated tests were added for the async existence-check + confirm/skip/error flows, but as previously noted this is non-blocking for a draft PR headed to human review.

Everything else — the UppyDashboard.tsx/Dashboard.jsx plugin wiring, translations, SingleFileUpload.tsx's discriminated confirm.type refactor, and the ConfirmActionIcon/warningIcon DRY extractions — still looks solid and consistent. Nice work resolving the outstanding concerns — this looks ready to hand off for human review.


✏️ Learnings added
Learnt from: jvega190
URL: https://github.com/craftercms/studio-ui/pull/4914

Timestamp: 2026-07-09T18:41:53.224Z
Learning: In ui/uppy/src/plugins/Dashboard.jsx, `checkPathAndUpload`'s error handler (used for validating whether an upload path already exists) must not proceed to upload the file; on error it should mark the file invalid with an error message and call `this.opts.onPathExistenceError?.(err)` instead of calling `startUpload()`, to stay consistent with the error-dialog behavior in ui/app/src/components/SingleFileUpload/SingleFileUpload.tsx.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

@jvega190 jvega190 assigned jvega190 and unassigned jvega190 Jul 9, 2026
@jvega190
jvega190 marked this pull request as ready for review July 9, 2026 19:48
@jvega190
jvega190 requested a review from rart as a code owner July 9, 2026 19:48

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@ui/uppy/src/plugins/Dashboard.jsx`:
- Around line 204-208: The fallback error message in Dashboard.jsx is hardcoded
in English, so non-English users see untranslated copy. Update the detail
fallback inside the Dashboard plugin’s error handling to pull this string from
locale.strings or externalMessages instead of using the literal text. Keep the
existing error-preference chain in place, and use the Dashboard localization
hooks/symbols already available in the component to resolve the translated
fallback.
- Around line 256-259: The finalize flow in Dashboard’s
validateFilesPolicy/confirmAll path can run twice when checkPathExistence
resolves synchronously, so make the onPendingChanges/onComplete completion path
idempotent. Add a local guard in the relevant Dashboard.jsx logic so the
finalize callback can only fire once even if pending counts reach zero during
the loop and again after the loop, and keep the behavior tied to the existing
validateFilesPolicy, confirmAll, and onPendingChanges flow.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 98536331-fcbd-45c8-97a0-7de0c1fbd5e2

📥 Commits

Reviewing files that changed from the base of the PR and between 802b887 and 3f06573.

📒 Files selected for processing (2)
  • ui/app/src/components/UppyDashboard/UppyDashboard.tsx
  • ui/uppy/src/plugins/Dashboard.jsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • ui/app/src/components/UppyDashboard/UppyDashboard.tsx

Comment thread ui/uppy/src/plugins/Dashboard.jsx Outdated
Comment thread ui/uppy/src/plugins/Dashboard.jsx
@jvega190

jvega190 commented Jul 9, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai can you check if everything looks good? Please give it a final review before I hand over for human review

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
gh pr view 4914 --repo craftercms/studio-ui --json commits,updatedAt -q '.commits[-5:] | .[] | .oid + " " + .messageHeadline'
echo "----"
gh pr diff 4914 --repo craftercms/studio-ui > /tmp/pr.diff
wc -l /tmp/pr.diff

Length of output: 859


🏁 Script executed:

#!/bin/bash
set -euo pipefail
grep -n '^diff --git' /tmp/pr.diff
echo "---"
grep -n 'test' /tmp/pr.diff -i | head -20

Length of output: 1603


🏁 Script executed:

#!/bin/bash
set -euo pipefail
sed -n '417,644p' /tmp/pr.diff

Length of output: 7113


All caught up — I re-pulled the latest diff and compared it against the state from my last review pass. No new commits since then introduce regressions on the three previously-flagged concerns, and the additional commits (Localize the fallback error message, Avoid double-calling onPendingChanges, Add onUploadStarted callback to checkPathAndUpload, Add dropped attributes from svg) are consistent with those fixes:

  • checkPathAndUpload's error handler still correctly marks the file invalid, sets an allowed: false message (now localized via this.i18n('pathExistenceCheckFailed') as a fallback), and calls this.opts.onPathExistenceError?.(err) — no silent overwrite path.
  • pendingExistenceChecks in validateFilesPolicy is computed upfront via response.filter(...).length before the forEach, so finalizeExistenceChecks() can't fire prematurely.
  • confirmAll now guards with pendingPathChecks/finalizePathChecks/finalized and only calls onPendingChanges(true) once, gated by if (uploading) — no more double-fire.
  • confirmOverwrite and validateAndRetry are straightforward and match the intended overwrite-confirmation UX.

The ui/uppy/src/plugins/locale.js diff (Line 644 onward) and the generatedLocale.d.ts addition are consistent with the new confirmOverwrite/pathExistenceCheckFailed strings.

Only remaining non-blocking note carried over from before: still no new/updated tests for the async existence-check + confirm/skip/error flows (bulk and single upload). Not blocking for handoff, but worth flagging to the human reviewer or a fast-follow.

Everything else looks good — this is ready to hand off for human review.

🐇✅

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