Skip to content

feat: add the user_connection and user_connection_status_requested event models - #1660

Merged
WilliamBergamin merged 2 commits into
mainfrom
feat-user-connection-status-requested-event
Oct 22, 2026
Merged

WilliamBergamin merged 2 commits into
mainfrom
feat-user-connection-status-requested-event

Conversation

@WilliamBergamin

@WilliamBergamin WilliamBergamin commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

This pull request adds the user_connection and user_connection_status_requested event models, so Bolt apps can register app.event(UserConnectionEvent.class, ...) and app.event(UserConnectionStatusRequestedEvent.class, ...).

  • UserConnectionEvent in slack-api-model, plus its handler and payload in slack-app-backend. One class covers both the connect and disconnect subtypes: trigger_id is set on connect, and enterprise_id can be set on disconnect. The subtype stays unset by default so Bolt keys the listener on the type alone, like EmojiChangedEvent.
  • UserConnectionStatusRequestedEvent in slack-api-model, plus its handler and payload in slack-app-backend, following EntityDetailsRequestedEvent.
  • Matches feat(types): add the user_connection and user_connection_status_requested events node-slack-sdk#2783.

Testing

From an app with features.user_connections enabled and subscribed to both events:

app.event(UserConnectionEvent.class, (payload, ctx) -> {
    UserConnectionEvent event = payload.getEvent();
    if ("connect".equals(event.getSubtype())) {
        ctx.client().appsUserConnectionRequestAuth(r -> r.triggerId(event.getTriggerId()).primaryProvider(provider));
    }
    return ctx.ack();
});

app.event(UserConnectionStatusRequestedEvent.class, (payload, ctx) -> {
    ctx.client().appsUserConnectionUpdate(r -> r.userId(payload.getEvent().getUser()).status("disconnected"));
    return ctx.ack();
});
  1. Click Connect on the app's profile and confirm the handler runs and the connection modal opens.
  2. Open the app as a user without a recorded connection status and confirm the handler runs and the update succeeds.

Category (place an x in each of the [ ])

  • bolt (Bolt for Java)
  • bolt-{sub modules} (Bolt for Java - optional modules)
  • slack-api-client (Slack API Clients)
  • slack-api-model (Slack API Data Models)
  • slack-api-*-kotlin-extension (Kotlin Extensions for Slack API Clients)
  • slack-app-backend (The primitive layer of Bolt for Java)

Requirements

Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you agree to those rules.

🤖 Generated with Claude Code

Slack sends this event when it has no connection status for a user, and
apps answer with apps.user.connection.update. The model lets Bolt apps
register app.event(UserConnectionStatusRequestedEvent.class, ...).
@codecov

codecov Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@383dd5f). Learn more about missing BASE report.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
..._backend/events/handler/UserConnectionHandler.java 0.00% 2 Missing ⚠️
.../handler/UserConnectionStatusRequestedHandler.java 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1660   +/-   ##
=======================================
  Coverage        ?   72.98%           
  Complexity      ?     4630           
=======================================
  Files           ?      486           
  Lines           ?    14632           
  Branches        ?     1524           
=======================================
  Hits            ?    10679           
  Misses          ?     3049           
  Partials        ?      904           
Flag Coverage Δ
jdk-14 72.98% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

Add UserConnectionEvent with its handler and payload, so Bolt apps can
register app.event(UserConnectionEvent.class, ...) for both the connect
and disconnect subtypes. The subtype stays unset by default so Bolt keys
the listener on the type alone, like EmojiChangedEvent. Also add event_ts
to UserConnectionStatusRequestedEvent to match node-slack-sdk#2783.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@WilliamBergamin WilliamBergamin changed the title feat: add the user_connection_status_requested event model feat: add the user_connection and user_connection_status_requested event models Oct 22, 2026
@WilliamBergamin WilliamBergamin self-assigned this Oct 22, 2026
@WilliamBergamin WilliamBergamin added this to the 1.52.1 milestone Oct 22, 2026
@WilliamBergamin
WilliamBergamin marked this pull request as ready for review October 22, 2026 20:52
@WilliamBergamin
WilliamBergamin requested a review from a team as a code owner October 22, 2026 20:52

@zimeg zimeg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

☕ @WilliamBergamin LGTM! It's exciting for what this unlocks 🔏

@zimeg zimeg added the enhancement M-T: A feature request for new functionality label Oct 22, 2026
@WilliamBergamin
WilliamBergamin merged commit e8352d1 into main Oct 22, 2026
7 checks passed
@WilliamBergamin
WilliamBergamin deleted the feat-user-connection-status-requested-event branch October 22, 2026 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement M-T: A feature request for new functionality project:slack-api-model project:slack-api-model project:slack-app-backend semver:minor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants