Slack Plugin 6.1.0: receive messages from a channel - #8
Merged
Merged
Conversation
Adds a `receive-message` action: a scheduled poller reads the channels a process link points at and starts a case per message, or continues a case with the reply in its thread. - Channels are derived from the process links, so a configuration nobody links to costs nothing. - A per-channel cursor keeps the first poll from turning a channel's history into cases; a claim table makes two nodes polling the same channel safe. - Thread replies are read per open conversation, from the position of the case that is furthest behind, because Slack keeps them out of a channel's history. - `post-message` now records the thread it posted in, and can answer inside an existing one. The sandbox app ships a stateful fake Slack (imports/slack-mock) so the whole loop can be driven without a workspace, app or token.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds a
receive-messageaction: a scheduled poller reads the channels a process link points at and starts a case per message, or continues a case with the reply in its thread.slack_processed_message) makes two nodes polling the same channel safe.post-messagenow records the thread it posted in, and can answer inside an existing one.The sandbox app ships a stateful fake Slack (
backend/app/imports/slack-mock) so the whole loop can be driven without a workspace, app or token.Review fixes included
Two correctness bugs found reviewing the changeset, both covered by new tests in
SlackClientTest:SlackClient.readConversationreversed every page on the premise that Slack answers newest first — true forconversations.history, butconversations.repliesreturns oldest first. The poller signals the waiting execution per message, so with two replies in one poll the case continued on the later reply and the earlier one — the answer it was waiting for — matched no waiting execution and was dropped with its claim already written.filesUploadthrew on a filename without an extension.fileName.split('.')[1]raisedIndexOutOfBoundsExceptiononLICENSE, and uploadedverslag.2026.pdfas a file of type2026.Known gap — documentation
documentation/plugin.md,documentation/getting-started.mdandREADME.mddo not yet carry their 6.1.0 sections; those changes were lost before this commit and need rewriting.documentation/release-notes.mdis up to date. To follow up on this branch before merge.Open design question
When
maxPagesPerPollis exhausted, the pages held are the newest stretch of the window and the cursor still advances to the newest handled message — so anything between the old cursor and the oldest page read is never fetched again. It is logged as a warning, but the outcome is a message that silently never becomes a case. Defaults make it rare (10 x 100 messages per 5-minute poll); worth deciding whether to keep the silent skip or stall the channel loudly instead.Verification
./gradlew :backend:plugin:test --rerun-tasks— 59 tests, 7 classes, green, includingSlackReceiveMessageITagainst a real process engine.ng build @valtimo-plugins/slack— clean.