Handle shareWithMe failures non-fatally in useWorkspaceData#157
Open
mcollard0 wants to merge 2 commits intoAppFlowy-IO:mainfrom
Open
Handle shareWithMe failures non-fatally in useWorkspaceData#157mcollard0 wants to merge 2 commits intoAppFlowy-IO:mainfrom
mcollard0 wants to merge 2 commits intoAppFlowy-IO:mainfrom
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideModify useWorkspaceData hook to gracefully handle share-with-me API failures by capturing the error to a global variable and proceeding with the standard workspace outline. Sequence diagram for non-fatal shareWithMe API failure handling in useWorkspaceDatasequenceDiagram
participant useWorkspaceData
participant service
participant window
useWorkspaceData->>service: getShareWithMe()
alt shareWithMe succeeds
service-->>useWorkspaceData: shareWithMe data
useWorkspaceData->>useWorkspaceData: Merge shareWithMe data into outline
else shareWithMe fails
service-->>useWorkspaceData: error
useWorkspaceData->>window: Set __RCF_LAST_SHARE_WITH_ME_ERROR__
useWorkspaceData->>useWorkspaceData: Continue with main workspace outline
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In self-hosted AppFlowy deployments the share-with-me API ( /api/sharing/workspace/:id/folder ) may be disabled or unconfigured, which currently results in noisy errors when loading the workspace outline. This change updates useWorkspaceData to catch failures from service.getShareWithMe, surface the error on window.RCF_LAST_SHARE_WITH_ME_ERROR for debugging, and continue using the normal workspace outline when share-with-me fails.
Summary by Sourcery
Handle failures from the share-with-me service non-fatally in useWorkspaceData by catching errors, exposing the last error on window.RCF_LAST_SHARE_WITH_ME_ERROR for debugging, and falling back to the standard workspace outline.
Enhancements: