sartography / spiff-arena

SpiffWorkflow is a software development platform for building, running, and monitoring executable diagrams
https://www.spiffworkflow.org/
GNU Lesser General Public License v2.1
51 stars 37 forks source link

Servers which need to be used to resolve the discord_name to discord_direct_ID #1813

Open harmeet-status opened 1 week ago

harmeet-status commented 1 week ago

Spiff will be implementing Discord Notifications and there is complexity around how we do this based on having multiples servers that we need to resolve the information.

Problem: Status has around 10 servers, almost each team has their own server (and staff is split across the servers). Spiff is used by everyone in the organisation and when trying to resolve someone's discord_username to discord_ID, we need to cycle through the various servers until we find 1 where we can do this resolution.

Obviously this approach is going to be time-consuming, when trying to send out notifications, so we need to do some digging.


Questions to answer:

  1. Does the discord_ID of a user ever change, even if they change their username?
harmeet-status commented 1 week ago

@calexh-sar @burnettk could you pls look into this.

calexh-sar commented 1 week ago

@calexh-sar @burnettk could you pls look into this.

@harmeet-status the UID is unique to the user and does not change if they change any of their other identifiers; username or display name.

harmeet-status commented 1 week ago

Ok that's good. This is how I envision the logic to work:

We already have a Data Store which keeps the Bamboo User data (refreshed daily). We need to have another Data Store which stores user preferences and also stores the discord_username and resolved discord_ID

IF the discord_username from Bamboo Data Store != match User Preferences Data Store, WE MUST resolve the discord_username TO discord_ID and store this in the User Pref DS. This logic will ensure that should the user change their username for Discord, we resolve the discord_ID to make sure that we are sending messages to the correct user account.

calexh-sar commented 1 week ago

@harmeet-status @jbirddog and I discussed this yesterday and since the core_contributor data store you referenced in your comment above is typeahead, it can only currently be accessed by a User Task form field. In order to be able to access the information directly in that data store like the other data stores, I added: Make typeahead data stores readable #1823. Jon estimated the 1 DD to make this happen. Otherwise we will need to create a duplicate kkv data store when that process is run.