-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Open
Labels
Description
Summary
The ownership rules widget crashes with TypeError: e?.trim is not a function when rendering team avatars. The backend serializes owner id as a Python int; the frontend Actor type expects id: string. When the team is missing from TeamStore, the numeric ID flows into getInitials() as name, and .trim() throws on a number.
Root Cause
add_owner_ids_to_schema() in grammar.py stores the raw DB integer:
# before
rule_owner["id"] = owners_id[rule_owner["identifier"]] # intSo the GET /api/0/{org}/{project}/ownership/ response looks like:
{ "type": "team", "name": "#my-team", "id": 2251960 }Downstream chain:
TeamStore.getById(owners[0].id)— string/number mismatch, returnsnull- Fallback renders
<Avatar name={teamId}>whereteamIdis the number2251960 getInitials(name)callsname.trim()→ crash
Confirmed in debugger: name = 2251960 (number), sanitizedName unavailable.
Versions Affected
Confirmed in demo org. Affects any project with ownership rules referencing teams not fully loaded in TeamStore.
Related
- Draft PR: fix(ownership): serialize owner IDs as strings to match Actor type contract #110592 (cursor/ownership-rules-id-type-9ade)
Action taken on behalf of David Cramer.
Reactions are currently unavailable