Skip to content

[BR-2136]:fix/upload unaccepted file deletes folder#2021

Open
jaaaaavier wants to merge 12 commits into
masterfrom
fix/folder-upload-delete-when-a-file-fail
Open

[BR-2136]:fix/upload unaccepted file deletes folder#2021
jaaaaavier wants to merge 12 commits into
masterfrom
fix/folder-upload-delete-when-a-file-fail

Conversation

@jaaaaavier

@jaaaaavier jaaaaavier commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Description

A bug was detected whereby a user attempted to upload a prohibited file (0 bytes) within a folder, when this was detected, the entire folder was deleted and the upload never took place, yet the task was marked as successful. Consequently, the user could search for the folder but would never find anything.

The purpose of this PR is to change the behaviour of this error: essentially, we will no longer delete files that have already been uploaded, and we will continue uploading the remaining pending files. Once this process is complete, we will display the relevant error message and allow the user to see which files have failed, but they will not be able to re-upload them.

Related Issues

Related Pull Requests

Checklist

  • Changes have been tested locally.
  • Unit tests have been written or updated as necessary.
  • The code adheres to the repository's coding standards.
  • Relevant documentation has been added or updated.
  • No new warnings or errors have been introduced.
  • SonarCloud issues have been reviewed and addressed.
  • QA Passed

Testing Process

After creating a new free account, uploading a folder containing valid files and a 0-byte file, verifying that the 0-byte file does not upload whilst the rest do, confirming that the workflow in which we can see the failed file does not allow it to be uploaded, and testing the upload of a normal folder, which uploads correctly

Additional Notes

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 3, 2026

Copy link
Copy Markdown

Deploying drive-web with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5614b24
Status: ✅  Deploy successful!
Preview URL: https://0625e237.drive-web.pages.dev
Branch Preview URL: https://fix-folder-upload-delete-whe.drive-web.pages.dev

View logs

@jaaaaavier jaaaaavier self-assigned this Jul 6, 2026
@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0cbbbaa6-a55a-4a7e-be73-06777045508c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/folder-upload-delete-when-a-file-fail

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.

@jaaaaavier jaaaaavier added the enhancement New feature or request label Jul 7, 2026
@jaaaaavier jaaaaavier marked this pull request as ready for review July 7, 2026 10:32
@jaaaaavier jaaaaavier requested review from a team, CandelR and larryrider as code owners July 7, 2026 10:32
isMaxSpaceError: boolean;
continueWithRemainingFiles: boolean;
}): void {
tasksService.updateTask({

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Although I haven't been too serious about this, the UploadManager is not the place to manage the logger tasks lifecycle, which is pure UI.


const options = { withNotification: true, ...payloadOptions };
options.onSuccess?.();
referralService.trackFolderUpload();

@sg-gs sg-gs Jul 7, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is the kind of things that make the code dirty without any gain: the upload folder manager has the responsibility of managing the folder's upload, not the tracking system. If you want to track something, expose a listener on the manager (or a callback like onFinish. In fact, the onSuccess callback above this line is a good place to do that) and keep the manager clean of non-context-related tasks

logNetworkInfoForUpload({ folderName: root.name });

setTimeout(() => {
this.dispatch(planThunks.fetchUsageThunk());

@sg-gs sg-gs Jul 7, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same here, this is the global status of the app, it should not be coupled to how the upload is managed on the context of the network:

A upload folder manager on the network folder is the place where the codebase manages exclusively the upload of a folder: sending the content, confirming the upload, emitting status events (error, success, progress) to any interested consumer and that's all.

The incipient codebase here where half the things are Redux, trackers or logger tasks management is something whose prevention we should start to enforce @CandelR, as it is starting to be out of hands.

@sg-gs

sg-gs commented Jul 7, 2026

Copy link
Copy Markdown
Member

Am sorry you are involved here @jaaaaavier but this is part of maintaining the project and from time to time you may be involved in correcting something that could not be directly related to your changes, but it's a part of being a good professional, remember it any time you introduce technical debt as other teammate could be affected in a near future haha.

@jaaaaavier

Copy link
Copy Markdown
Contributor Author

Am sorry you are involved here @jaaaaavier but this is part of maintaining the project and from time to time you may be involved in correcting something that could not be directly related to your changes, but it's a part of being a good professional, remember it any time you introduce technical debt as other teammate could be affected in a near future haha.

No problem, understood

@sonarqubecloud

sonarqubecloud Bot commented Jul 8, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
76.5% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants