This repository was archived by the owner on Sep 3, 2025. It is now read-only.
feat(scheduler): keep participant list in sync #5460
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new scheduled task to ensure that the participant list for incidents is kept in sync with the members of associated Slack conversations. Additionally, it optimizes Slack API calls by implementing a caching mechanism to improve efficiency.
Key Changes
Scheduled Task for Member Sync:
incident_sync_membersthat runs every hour.Slack API Enhancements:
WebClientWrapperclass to ensure that Slack API client instances with the same token are treated as equal for caching purposes.get_all_member_emailsto fetch all member emails from a Slack conversation, which is utilized in the member sync task.Code Refactoring:
SlackAPIGetEndpointsenum to include theconversations_membersendpoint.Files Changed
src/dispatch/incident/scheduled.py: Added theincident_sync_membersfunction.src/dispatch/plugins/dispatch_slack/enums.py: Updated to include the new Slack API endpoint.src/dispatch/plugins/dispatch_slack/plugin.py: Added theget_all_member_emailsmethod.src/dispatch/plugins/dispatch_slack/service.py: Implemented caching for Slack API calls and refactored existing methods.Fixes DISDEV-66.