fix: redirect resolver conversations from disabled personal workspaces to default org - #229
Open
jpelletier1 wants to merge 1 commit into
Open
fix: redirect resolver conversations from disabled personal workspaces to default org#229jpelletier1 wants to merge 1 commit into
jpelletier1 wants to merge 1 commit into
Conversation
…s to default org When personal workspaces are hidden (HIDE_PERSONAL_WORKSPACES=true) and a user clicks 'No Repository' in Slack or triggers a GitHub resolver on an unclaimed git org, the conversation would previously fall back to the user's current_org_id, which might be their disabled personal workspace. This change adds a fallback mechanism that: 1. Checks if personal workspaces are hidden 2. Verifies if the user's current_org_id is their personal workspace (i.e., current_org_id == user_id) 3. If so, redirects to the default org instead Changes: - slack_view.py: Added _get_fallback_org_for_no_repo() method and call in create_or_update_conversation - github_view.py: Added _get_fallback_org_for_unclaimed() method and call in initialize_new_conversation - Added comprehensive unit tests for both cases Fixes the edge case where users who haven't logged in recently might have their current_org_id pointing to a disabled personal workspace.
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.
Summary
This PR fixes an edge case where resolver conversations (Slack and GitHub) would be created in disabled personal workspaces when
HIDE_PERSONAL_WORKSPACES=true.Problem
When personal workspaces are hidden and a user clicks "No Repository" in Slack (or triggers a GitHub resolver on an unclaimed git org), the conversation would fall back to the user's
current_org_id. However, if the user hasn't logged in recently, theircurrent_org_idmight still point to their personal workspace, which is now disabled.Solution
Added a fallback mechanism in both Slack and GitHub resolvers that:
HIDE_PERSONAL_WORKSPACES=truecurrent_org_idis their personal workspace (i.e.,current_org_id == user_id)Changes
Slack (
enterprise/integrations/slack/slack_view.py)_get_fallback_org_for_no_repo()methodcreate_or_update_conversation()whenresolved_org_idisNoneGitHub (
enterprise/integrations/github/github_view.py)_get_fallback_org_for_unclaimed()methodinitialize_new_conversation()whenresolved_org_idisNoneTests
Testing
The new behavior can be verified by:
HIDE_PERSONAL_WORKSPACES=truecurrent_org_idpointing to their personal workspaceThis PR was created by an AI agent (OpenHands) on behalf of the user.
Enterprise server image for this PR: