- Shipped
- August 29, 2026 at 5:58 AM UTC
- Author
- Kamo
- Commit
- a1578a1
The browser tab is being retitled "{Org} - {role} Portal", and a team member's role is their department — the specific thing they identify with day to day ("Sales"), rather than the generic word for staff. The department is on the TeamMember subtype, not on Member, so it needs the join this adds; the query already reached member_team_member for member_type, so it is one more LEFT JOIN rather than a second trip. Written into the session because that is where the client reads this kind of thing from: kamo-internal's /api/user-info serves the Redis session blob directly, so a field that is not in the blob costs every consumer a separate request for it. Omitted rather than stored as null when the member has no department, which is the COMMON case — 67 of 83 team-member rows in production have none. A consumer testing only for presence would otherwise render the absence as somebody's job title. The payload assembly is extracted to buildTeamMemberPayload so that one rule is testable without standing up Redis. Sessions minted before this carry no department and stay valid; the tab falls back to the organization's own team-member label, exactly as it does for the majority who have no department at all.