Skip to content

[API-1477] Don't post duplicate messages to a thread with multiple targets#2

Merged
ginnymin merged 3 commits intomainfrom
ginny/API-1477-multiple-targets
Jan 12, 2026
Merged

[API-1477] Don't post duplicate messages to a thread with multiple targets#2
ginnymin merged 3 commits intomainfrom
ginny/API-1477-multiple-targets

Conversation

@ginnymin
Copy link
Copy Markdown

@ginnymin ginnymin commented Jan 9, 2026

API-1477

When using glue/notify for posting to a thread with multiple targets, we were getting duplicate messages being posted in the thread due to the notify script looping through the targets and calling curl to the webhook for each target. This adds a check to only do the loop when thread subject and threadBy are not provided, otherwise making a single call to the webhook for threads.

Comment thread .circleci/test-deploy.yml
mac:
macos:
xcode: 14.0.0
xcode: 14.3.1
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

integration-test-templates-mac was erroring with a "resource not available for this class" type of error. Used this guide to select a version that is available.

Comment thread src/scripts/notify.sh
for i in $(eval echo \""$GLUE_PARAM_TARGET"\" | sed "s/,/ /g"); do
echo "Sending to Glue Target: $i"
GLUE_MSG_BODY=$(echo "$GLUE_MSG_BODY" | jq --arg target "$i" '.target = $target')
SendToTarget() {
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

SendToTarget wraps the previous logic that was being executed in the for loop; PostToGlue now has a conditional check for the threadBy or threadSubject to determine whether or not to call SendToTarget in a loop or not.

Copy link
Copy Markdown

@lucaspeterson22 lucaspeterson22 left a comment

Choose a reason for hiding this comment

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

LGTM

Comment thread src/examples/notify_thread.yml Outdated
`thread_subject` parameter determines the subject of the thread.
`thread_by` parameter holds a thread identifier in case there are multiple notifications in the pipeline.

Note: target must be a group(s) if a thread is specified.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
Note: target must be a group(s) if a thread is specified.
Note: target must be a group(s) if a `thread_subject` is specified.

@ginnymin ginnymin merged commit ae173b4 into main Jan 12, 2026
10 checks passed
@ginnymin ginnymin deleted the ginny/API-1477-multiple-targets branch January 12, 2026 14:38
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.

3 participants