Skip to content

Slack: profiles lack custom fields, the full name pair, and shared channels - #827

Closed
itz4blitz wants to merge 1 commit into
mainfrom
issue/592-slack-profile-fields
Closed

itz4blitz wants to merge 1 commit into
mainfrom
issue/592-slack-profile-fields

Conversation

@itz4blitz

Copy link
Copy Markdown
Collaborator

What changed and why

A Slack profile now keeps the display name and the full name, the department, workspace owner or admin, and labelled custom fields. A manager field is that person's link. The card still asks once an hour; the labelled profile is the one extra call, and a workspace that refuses it still gets the rest of the card.

Shared channels stay a hand-off: Slack does not offer them to a member for someone else. Editing your own name, title, or photo is the same hand-off.

Type

  • feature
  • fix
  • perf
  • refactor
  • chore
  • docs

Platforms

  • windows
  • macos
  • linux
  • android
  • ios

Proof

Scenario: e2e/scenarios/slack-profile-fields

Lab run:

Compatibility

No protocol change. The profile fields, department, and roles were already on the card. An older server is not involved.

Risk and rollback

Opening a profile makes one more users.profile.get per person per hour. If that call fails, the card is still the one users.info already gave. Revert this commit to undo it.

Release note

Slack profiles show both names, custom fields, and whether someone is an owner or an admin.

How tested

cargo test -p chatd --no-default-features a_profile_card_keeps_custom_fields --lib

cargo test -p chatd --no-default-features presence_a_profile_and_signing_out --test slack

cargo clippy -p chatd --no-default-features --all-targets

Not tested: a live Slack workspace, the person pane drawing leftover field lines, or opening the manager link from that pane.

Closes #592

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Tiny Code Review

⚠️ Code review unavailable · run

the AI provider rate-limited the request

This is advice, not a gate. Re-run with the agent:review label or a /review comment.

@unRekable unRekable left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

🟡 1 finding (0 blocking).

The change adds labelled custom fields, both names, workspace roles and a manager deep link to Slack profile cards, plus an image_512 portrait variant. It stays inside chatd, changes no protocol type, sends the extra users.profile.get to the same Slack host under the existing pacer and the once-per-person-per-hour gate, and degrades gracefully when a workspace refuses it (expired/halted state is still recorded inside checked() before the Fault is swallowed). Strings are clipped at the window boundary by the pre-existing typed_profile, push_field caps at PROFILE_FIELDS, the deep link is built only from looks_like_user-validated alphanumeric ids, and the new Kept.portrait note field deserializes with a default so older notes still read. One gap: no automated test runs the merge success path, so a broken merge_labelled_profile would ship with every check green.

Residual risk

  • The e2e driver proves the pure about_of function on hand-built JSON, so the lab proof does not drive the real users.info/users.profile.get request path; a fixture in the integration test would cover most of that gap.
  • A custom field of type "user" whose workspace has no team_id and whose alt is empty falls through to the raw Slack id as the field text instead of a name or link.
  • A custom field labelled "email" is pushed as a contact with no shape check beyond non-emptiness; it is clipped to 200 characters at the window boundary but otherwise displayed as typed.
  • profile() now makes two sequential blocking API calls where there was one, so opening a card on a slow workspace can take up to twice as long before the hourly cache takes over.

assert!(profile.fields.iter().any(|(label, value)| label == "Full name" && value == "Ana Lima"));
assert_eq!(world.fake.calls(ALPHA, "users.info").len(), before + 1);
assert!(world.fake.calls(ALPHA, "users.profile.get").is_empty());
let labelled = world.fake.calls(ALPHA, "users.profile.get");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Major: No test exercises the merge success path: the fake has no users.profile.get answer, so here it is refused (unknown_method) and only the degrade branch runs; the unit test and the e2e prove driver both call about_of with fields already embedded, bypassing merge_labelled_profile. If the merge stopped copying 'fields', no check in CI or the lab would fail while custom fields silently disappear from the card. Add a users.profile.get fixture with a labelled field (like the inline users.info answer) and assert that label reaches profile.fields here.

A profile reads labelled custom fields once an hour, keeps the full name beside the display name, and turns a manager into that person's link.

Closes #592
@itz4blitz

Copy link
Copy Markdown
Collaborator Author

Superseded by and merged in #903 (d387971 — Release 2026-11-20 combined PR).

@itz4blitz itz4blitz closed this Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Slack: profiles lack custom fields, the full name pair, and shared channels

2 participants