Skip to content

Conversation

zhyd1997
Copy link
Contributor

@zhyd1997 zhyd1997 commented Sep 17, 2025

Close #14572

CleanShot 2025-09-18 at 02 10 49@2x

Updated the `castWorkspaceToAvailableWorkspace` method to sign the workspace logo URL if it exists.

Added error handling to fallback to the original logo URL in case of signing failure.

This improves the reliability of logo display in user workspaces.
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Summary

This PR fixes workspace icons not appearing in the workspace switcher menu by enhancing logo URL handling in the UserWorkspaceService. The main change is in the castWorkspaceToAvailableWorkspace method, which now signs workspace logo URLs using the FileService.signFileUrl method when a logo exists.

The implementation adds defensive programming practices by first checking if a workspace logo exists using isDefined(workspace.logo), then attempting to sign the URL with proper workspace authentication tokens. If the signing process fails for any reason (network issues, token generation problems, etc.), the code gracefully falls back to the original logo URL rather than breaking the workspace display.

This change addresses the core issue where workspace logos stored as file URLs needed to be signed with JWT tokens to be properly accessible by the frontend. The signFileUrl method creates the necessary authentication tokens and builds a signed path that allows the frontend to display logo images securely. The solution maintains backward compatibility while adding the security layer required for proper file access in the workspace switcher interface.

Confidence score: 4/5

  • This PR is safe to merge with minimal risk as it implements proper error handling and fallback mechanisms
  • Score reflects well-structured defensive programming with try-catch blocks that prevent breaking changes
  • Pay close attention to the logo URL signing logic in the UserWorkspaceService to ensure it integrates properly with existing file service patterns

1 file reviewed, no comments

Edit Code Review Bot Settings | Greptile

Copy link
Contributor

github-actions bot commented Sep 17, 2025

🚀 Preview Environment Ready!

Your preview environment is available at: http://bore.pub:47551

This environment will automatically shut down when the PR is closed or after 5 hours.

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.

Workspace icons don’t appear in the workspace switcher menu
1 participant