Repository navigation
Conversation
Tiny Code Reviewthe AI provider rate-limited the request This is advice, not a gate. Re-run with the |
unRekable
left a comment
There was a problem hiding this comment.
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"); |
There was a problem hiding this comment.
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
2ac8211 to
1d8ad3e
Compare
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
Platforms
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.getper person per hour. If that call fails, the card is still the oneusers.infoalready 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 --libcargo test -p chatd --no-default-features presence_a_profile_and_signing_out --test slackcargo clippy -p chatd --no-default-features --all-targetsNot tested: a live Slack workspace, the person pane drawing leftover field lines, or opening the manager link from that pane.
Closes #592