Skip to content

Comments

[PB-5715] fix(thumbnails): use workspace bucket for workspace uploads#1838

Open
douglas-xt wants to merge 6 commits intomasterfrom
fix/thumbnail-workspace-credentials
Open

[PB-5715] fix(thumbnails): use workspace bucket for workspace uploads#1838
douglas-xt wants to merge 6 commits intomasterfrom
fix/thumbnail-workspace-credentials

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

  1. From the Windows desktop client, upload an image file to a workspace
  2. Open the web app and navigate to that workspace — the thumbnail should be visible in the file list without opening the file viewer
  3. From User A, upload an image to a workspace
  4. Log in as User B (with access to the same workspace) and navigate to it — the thumbnail should be visible in the file list without opening the file viewer
  5. For existing files uploaded before this fix, thumbnails stored in the personal bucket should still be visible

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: b909488
Status: ✅  Deploy successful!
Preview URL: https://ba4d8802.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 🚀

@douglas-xt douglas-xt changed the title [_] fix(thumbnails): use workspace bucket for workspace uploads [PB-5715] fix(thumbnails): use workspace bucket for workspace uploads Feb 17, 2026
@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