chore(seer-slack): Move organization resolution to control#113107
Draft
chore(seer-slack): Move organization resolution to control#113107
Conversation
Comment on lines
+98
to
+109
| integration=self.integration, | ||
| slack_user_id=self.user_id, | ||
| channel_id=self.channel_id, | ||
| thread_ts=self.thread_ts or None, | ||
| is_welcome_message=self.is_assistant_thread_event, | ||
| ) | ||
| return SeerResolutionResult( | ||
| organization_id=None, error_reason=SeerSlackHaltReason.IDENTITY_NOT_LINKED | ||
| ) | ||
|
|
||
| ois = integration_service.get_organization_integrations( | ||
| integration_id=self.integration.id, |
Contributor
There was a problem hiding this comment.
RuntimeError when resolve_seer_organization accesses self.integration without validation
The new resolve_seer_organization() method accesses self.integration at lines 98 and 109, but self.integration raises RuntimeError when _integration is None. The _integration field is only populated by _get_context() which is called from validate(). The middleware parser (_maybe_get_response_from_event_request in slack.py:297-306) creates a SlackEventRequest and calls resolve_seer_organization() without first calling validate(), causing a RuntimeError to be raised.
Also found at 1 additional location
src/sentry/middleware/integrations/parsers/slack.py:303-303
Identified by Warden sentry-backend-bugs · RA8-UWS
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.
This is set up to allow us to properly route for integrations sharing installations across cells.