Skip to content

Conversation

@douglas-xt
Copy link
Contributor

@douglas-xt douglas-xt commented Feb 5, 2026

Description

When users upload files from desktop clients to their workspaces, both the file and thumbnail are sent to the correct workspace bucket using the appropriate context. However, the web application always uses the personal storage context when downloading thumbnails, regardless of where they were actually stored. This causes thumbnails from workspace uploads to fail to display. The issue only appears with desktop uploads because when uploading directly from web, it uses the same incorrect personal context for both upload and download, so they accidentally match and work.

The file upload flow was corrected by adjusting how we determine whether a file belongs to a workspace or personal storage. Instead of using a hardcoded value, the upload context is now evaluated dynamically to retrieve the appropriate credentials from the environment. This ensures that when uploading a file to a workspace, both the file and its thumbnail are stored in the same workspace storage location, guaranteeing that files and their thumbnails always reside together in the correct storage space.

Additionally, backward compatibility was implemented for existing thumbnails that were previously stored in the wrong location. When downloading a thumbnail, the actual storage location is verified and the appropriate credentials are used to retrieve it. This means users with older thumbnails that were incorrectly stored in personal buckets can still view them seamlessly, while all new uploads follow the corrected behavior. This approach ensures a smooth transition without requiring migration of existing thumbnails or disrupting the user experience.

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

Additional Notes

@douglas-xt douglas-xt requested review from a team, CandelR and larryrider as code owners February 5, 2026 10:30
@douglas-xt douglas-xt changed the title [] fix(thumbnails): use workspace bucket for workspace uploads [_] fix(thumbnails): use workspace bucket for workspace uploads Feb 5, 2026
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Feb 5, 2026

Deploying drive-web with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9a1962a
Status: ✅  Deploy successful!
Preview URL: https://f896954f.drive-web.pages.dev
Branch Preview URL: https://fix-thumbnail-workspace-cred.drive-web.pages.dev

View logs

},
{
isTeam: false,
isTeam: !!this.options?.ownerUserAuthenticationData?.workspaceId,
Copy link
Member

Choose a reason for hiding this comment

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

Is this flag the workspace correct flag or a deprecated flag of the previous deprecated version? Provide a GitHub ref demonstrating so pls

Copy link
Contributor Author

Choose a reason for hiding this comment

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

isTeam is the name of an external boolean variable (ref) that's passed as an argument to get environment config (ref). The confusion likely comes from outdated JSDoc (ref) that references isTeam, but the actual parameter is isWorkspace.

Copy link
Collaborator

@CandelR CandelR left a comment

Choose a reason for hiding this comment

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

@douglas-xt Remember to fill the testing process :). Good job 🚀

@sonarqubecloud
Copy link

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.

4 participants