fix(ownership): serialize owner IDs as strings to match Actor type contract#110592
Closed
fix(ownership): serialize owner IDs as strings to match Actor type contract#110592
Conversation
…ntract - Convert numeric owner IDs to strings in add_owner_ids_to_schema() - Add defensive string coercion in getInitials() to handle non-string names - Normalize IDs in TeamStore.getById() to handle string/number mismatch - Add tests for all three defensive fixes Fixes the 'trim is not a function' error in ownership rules widget where numeric team IDs were being passed as the name parameter to getInitials(). The frontend Actor type expects id: string, but the backend was returning id as a number. Co-authored-by: David Cramer <dcramer@users.noreply.github.com>
Contributor
|
🚨 Warning: This pull request contains Frontend and Backend changes! It's discouraged to make changes to Sentry's Frontend and Backend in a single pull request. The Frontend and Backend are not atomically deployed. If the changes are interdependent of each other, they must be separated into two pull requests and be made forward or backwards compatible, such that the Backend or Frontend can be safely deployed independently. Have questions? Please ask in the |
This was referenced Mar 12, 2026
Add explicit type annotation and intermediate variables to resolve mypy's Collection indexing error when accessing nested dict items. Co-authored-by: David Cramer <dcramer@users.noreply.github.com>
Contributor
Backend Test FailuresFailures on
|
Update test assertions to expect string IDs instead of numeric IDs in schema responses. This aligns with the fix that serializes owner IDs as strings to match the frontend Actor type contract. Co-authored-by: David Cramer <dcramer@users.noreply.github.com>
Contributor
Backend Test FailuresFailures on
|
Fix remaining test assertions that check the stored database schema (with 'identifier' field) to expect string IDs instead of numeric IDs. This includes test_schema_is_correct, test_schema_preserves_comments, test_raw_email_correct_schema, test_post_with_schema, and test_get. Co-authored-by: David Cramer <dcramer@users.noreply.github.com>
Contributor
Backend Test FailuresFailures on
|
Member
Author
|
gonna close this it was mostly trying to see if cursor would do ok |
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.
Fixes ownership rules widget crash by ensuring owner IDs are consistently serialized as strings.
The "e?.trim is not a function" error occurred because the backend's ownership rules GET endpoint returned numeric owner IDs, while the frontend's
Actortype expected string IDs. When a numeric ID was passed to avatar rendering logic, it caused a crash.Fixes #110588