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

Slack: Use Member Join Event instead of Message #167

Merged
merged 1 commit into from
Sep 27, 2023

Conversation

SanderGi
Copy link
Member

Changes outlined in this task:
https://app.asana.com/0/1203067047205953/1205542154436394

The production app will need the "member_joined_channel" event added to the "bot_events" section of the "settings" section of the app manifest:

bot_events:
      - member_joined_channel
      - message.channels
      - message.groups

Q/A checklist

  • Do a code review of the changes
  • Add any new dependencies to poetry & export to requirementst.txt (poetry export -o requirements.txt)
  • Carefully think about the stuff that might break because of this change
  • The relevant pages still run when you press submit
  • If you added new settings / knobs, the values get saved if you save it on the UI
  • The API for those pages still work (API tab)
  • The public API interface doesn't change if you didn't want it to (check API tab > docs page)
  • Do your UI changes (if applicable) look acceptable on mobile?

@SanderGi SanderGi requested a review from devxpy September 23, 2023 01:18
@devxpy
Copy link
Member

devxpy commented Sep 25, 2023

Have you updated the manifests for dev and prod apps and made sure they are backwards compact for existing integrations?

@SanderGi
Copy link
Member Author

Have you updated the manifests for dev and prod apps and made sure they are backwards compact for existing integrations?

Just added it to the prod app manifest - dev app is already set. It was backwards compatible for the test channels I had so should be fine for all existing integrations. This is a very minor change to listen to an event that would otherwise be ignored.

@devxpy devxpy merged commit 313300e into master Sep 27, 2023
@devxpy
Copy link
Member

devxpy commented Sep 27, 2023

Did you test this PR before submitting it?

@devxpy
Copy link
Member

devxpy commented Sep 27, 2023

It looks like the slack event is this:

2023-09-27T06:23:36.376796307Z > slack_event: {'token': 'tGdQuVhZFM8n79gOJvnqmd1y', 'team_id': 'T05JGLKFD71', 'context_team_id': 'T05JGLKFD71', 'context_enterprise_id': None, 'api_app_id': 'A05KQQ0NHUL', 'event': {'type': 'member_joined_channel', 'user': 'U05LL96137B', 'channel': 'C05L1158P89', 'channel_type': 'C', 'team': 'T05JGLKFD71', 'event_ts': '1695795754.000600'}, 'type': 'event_callback', 'event_id': 'Ev05US80QDMW', 'event_time': 1695795754, 'authorizations': [{'enterprise_id': None, 'team_id': 'T05JGLKFD71', 'user_id': 'U05KQRQLM0U', 'is_bot': True, 'is_enterprise_install': False}], 'is_ext_shared_channel': False, 'event_context': '4-eyJldCI6Im1lbWJlcl9qb2luZWRfY2hhbm5lbCIsInRpZCI6IlQwNUpHTEtGRDcxIiwiYWlkIjoiQTA1S1FRME5IVUwiLCJjaWQiOiJDMDVMMTE1OFA4OSJ9'}

Which throws this key error - https://dara-network.sentry.io/issues/4507231400/?project=4504338635423744&query=is%3Aunresolved&referrer=issue-stream&stream_index=0

@SanderGi
Copy link
Member Author

Did you test this PR before submitting it?

Weird. I did test it and it worked locally. Lmk take a look at it again

@SanderGi
Copy link
Member Author

SanderGi commented Sep 27, 2023

It looks like the slack event is this:

2023-09-27T06:23:36.376796307Z > slack_event: {'token': 'tGdQuVhZFM8n79gOJvnqmd1y', 'team_id': 'T05JGLKFD71', 'context_team_id': 'T05JGLKFD71', 'context_enterprise_id': None, 'api_app_id': 'A05KQQ0NHUL', 'event': {'type': 'member_joined_channel', 'user': 'U05LL96137B', 'channel': 'C05L1158P89', 'channel_type': 'C', 'team': 'T05JGLKFD71', 'event_ts': '1695795754.000600'}, 'type': 'event_callback', 'event_id': 'Ev05US80QDMW', 'event_time': 1695795754, 'authorizations': [{'enterprise_id': None, 'team_id': 'T05JGLKFD71', 'user_id': 'U05KQRQLM0U', 'is_bot': True, 'is_enterprise_install': False}], 'is_ext_shared_channel': False, 'event_context': '4-eyJldCI6Im1lbWJlcl9qb2luZWRfY2hhbm5lbCIsInRpZCI6IlQwNUpHTEtGRDcxIiwiYWlkIjoiQTA1S1FRME5IVUwiLCJjaWQiOiJDMDVMMTE1OFA4OSJ9'}

Which throws this key error - https://dara-network.sentry.io/issues/4507231400/?project=4504338635423744&query=is%3Aunresolved&referrer=issue-stream&stream_index=0

Edit: I see you already fixed it

@SanderGi
Copy link
Member Author

Did you test this PR before submitting it?

Weird. I did test it and it worked locally. Lmk take a look at it again

I think I figured out what went wrong: I had both the prod app and dev app integrated to the same channel and saw the prod app working but thought it was the dev app 🤦‍♂️. Won't happen again

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.

2 participants