Skip to content

[PB-6600]:refactor/upload managers to only handle networks context#2030

Open
jaaaaavier wants to merge 2 commits into
masterfrom
refactor/uploadManager-and-uploadManagerFolder
Open

[PB-6600]:refactor/upload managers to only handle networks context#2030
jaaaaavier wants to merge 2 commits into
masterfrom
refactor/uploadManager-and-uploadManagerFolder

Conversation

@jaaaaavier

@jaaaaavier jaaaaavier commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Description

The aim of this PR is to relieve the UploadManager and UploadManagerFolder files of the responsibility for managing the lifecycle of tasks, trackings, loggings and other matters unrelated to upload management which is, after all, what they should be doing.

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

I’ve tested the preview version for uploading new files and folders, and there were no problems.

Additional Notes

@jaaaaavier jaaaaavier self-assigned this Jul 8, 2026
@jaaaaavier jaaaaavier added the enhancement New feature or request label Jul 8, 2026
@jaaaaavier jaaaaavier marked this pull request as ready for review July 8, 2026 10:02
@jaaaaavier jaaaaavier requested review from a team, CandelR and larryrider as code owners July 8, 2026 10:02
Comment thread src/app/tasks/upload/uploadFolderTaskLifecycle.ts
@cloudflare-workers-and-pages

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

Copy link
Copy Markdown

Deploying drive-web with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6fb8f95
Status: ✅  Deploy successful!
Preview URL: https://eac62ae8.drive-web.pages.dev
Branch Preview URL: https://refactor-uploadmanager-and-u.drive-web.pages.dev

View logs

@sonarqubecloud

sonarqubecloud Bot commented Jul 9, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

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

See analysis details on SonarQube Cloud

@jaaaaavier jaaaaavier requested a review from sg-gs July 9, 2026 06:58
progress: uploadProgress,
},
});
this.taskLifecycle.updateTaskProgress(taskId, uploadProgress);

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.

Again, it's not the responsibility of the upload manager to manage the tasks lifecycle. The upload manager may have events/callbacks like onFileUploaded or onFolderUploaded that could be used to manage tasks by injecting specific callbacks, but that should happen outside of here.

Right now, the control flow is

The component starts the upload
-> The upload service (say folder or file, whatever)
-> Upload Manager (handles the data transfer)
-> Tasks Management (handles UI)

The control flow should be

The component starts the upload
-> The upload service (say folder or file, whatever)
-> Tasks Management (handles UI)
-> Upload Manager (handles the data transfer)

There is still a dependency between two unrelated things, making the code coupled and far less maintainable (and testable): the tasks management and the upload manager.

Think it like this: if you had to change something related to the tasks management, does it have sense to go to the upload manager to make changes? It sounds like something strange is going on there. If you want to change something related to tasks, you go to the tasks management related-code only.

Consider this reading @jaaaaavier, as although for this specific PR and topic seems trivial, it is worth a lot in the medium and long term for our growing codebase

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