Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add missing fields in ChannelCreatedEvent #2166

Merged
merged 1 commit into from
Jul 15, 2024

Conversation

maxretries
Copy link
Contributor

Summary

fixes #2165

Adds missing fields in ChannelCreatedEvent interface.

Requirements (place an x in each [ ])

Copy link

codecov bot commented Jul 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.07%. Comparing base (c00bad7) to head (5af3bb0).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2166   +/-   ##
=======================================
  Coverage   82.07%   82.07%           
=======================================
  Files          18       18           
  Lines        1545     1545           
  Branches      443      443           
=======================================
  Hits         1268     1268           
  Misses        179      179           
  Partials       98       98           

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

@WilliamBergamin
Copy link
Contributor

Thanks for the contribution @maxretries

The following is the schema of the channel_created event taken from this morning

"payload": {
        "token": "E1a2b3c",
	"team_id": "T123",
	"api_app_id": "A123",
	"event": {
		"type": "channel_created",
		"channel": {
			"id": "C123",
			"name": "hello-this-is-a-test",
			"is_channel": true,
			"is_group": false,
			"is_im": false,
			"is_mpim": false,
			"is_private": false,
			"created": 1721054427,
			"is_archived": false,
			"is_general": false,
			"unlinked": 0,
			"name_normalized": "hello-this-is-a-test",
			"is_shared": false,
			"is_frozen": false,
			"is_org_shared": false,
			"is_pending_ext_shared": false,
			"pending_shared": [],
			"context_team_id": "T123",
			"updated": 1721054427220,
			"parent_conversation": null,
			"creator": "U123",
			"is_ext_shared": false,
			"shared_team_ids": [
				"T123"
			],
			"pending_connected_team_ids": [],
			"topic": {
				"value": "",
				"creator": "",
				"last_set": 0
			},
			"purpose": {
				"value": "",
				"creator": "",
				"last_set": 0
			},
			"previous_names": []
		},
		"event_ts": "1721054427.004200"
	},
	"type": "event_callback",
	"event_id": "E123",
	"event_time": 1721054427,
	"authorizations": [
		{
			"enterprise_id": null,
			"team_id": "T123",
			"user_id": "U123",
			"is_bot": true,
			"is_enterprise_install": false
		}
	],
	"is_ext_shared_channel": false
}

This aligns with the example payload found in the java payload as well

Copy link
Contributor

@WilliamBergamin WilliamBergamin left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution 💯

All these fields are valid 👍

is_archived, is_frozen, is_external_shared, is_pending_ext_shared and others should always be false on the channel_created event, since the channel is new. I don't think this object needs to include them but we can leave them in

@WilliamBergamin WilliamBergamin merged commit 6734565 into slackapi:main Jul 15, 2024
9 checks passed
@maxretries
Copy link
Contributor Author

Hi @WilliamBergamin thanks for merging this. These fields don't seem be be false always, I have seen channel_created event with is_archived: true, is_frozen: true and frozen_reason as connection severed. Looks like this can happen with Slack connect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multiple fields missing in ChannelCreatedEvent interface
3 participants