Repository navigation
fix(social): label Manage access grantees from object handle fields (#164) - #165
Conversation
Bot Social returns grant.grantee as a publicBot object, not a string. String(grantee) became "[object Object]" and the handle sanitizer turned that into @objectobject. grantPersonView / normalizeGrant now read handle and owner_display_name (then display_name). The same unwrap is applied in social.js norm(), hidden-remotes, and face-room handle helpers. Regression tests cover grantPersonView, listGrants, and social/access with an object-shaped grantee. ARCH_DOCS_BASE=upstream/main npm run verify passes. Co-authored-by: Danyang Chen <birfychen@gmail.com>
Point the changelog fragment and social subsystem note at the filed issue so the PR can close it with Fixes ThinkFlowLab#164. Co-authored-by: Danyang Chen <birfychen@gmail.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fa3d5ecceb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const member = memberHandleOf(raw) | ||
| const home = personHomeOf(raw) | ||
| const rawName = String(grant?.name ?? '').trim() | ||
| const rawName = personNameOf(grant?.name) || personNameOf(peer) || personNameOf(grant) |
There was a problem hiding this comment.
Preserve owner names across grant resynchronization
When an object grantee's owner_display_name differs from its home slug (for example, Alice Smith for @helper.account42.home), normalizeGrant first produces Alice Smith (@account42.home), but syncOutgoingGrants immediately passes that normalized grant through grantPersonView again. This line then reads the already-formatted label, the following /@/ check treats it as handle text, and the stored/access label becomes Account42 (@account42.home), so the new owner field is only displayed correctly when it happens to match the slug as in the added Bob fixture. Preserve the raw person name or recognize an already-formatted label before re-normalizing it.
Useful? React with 👍 / 👎.
Fixes #164.
Bot Social's
list_bot_grantsreturnsgranteeas apublicBotobject (handle,display_name,owner_display_name), not a string.grantPersonViewwas doingString(grantee)→[object Object]→@objectobject.grantPersonView/normalizeGrantreadhandleandowner_display_name(thendisplay_name) from that object.ARCH_DOCS_BASE=upstream/main npm run verifypasses.Fixes #164