Repository navigation
fix: send thread_ts once in chat.postMessage requests - #1684
Adam-Schildkraut wants to merge 6 commits into
Conversation
|
hey again @mwbrooks! this one’s much simpler than my last PR 😄 caught |
WilliamBergamin
left a comment
There was a problem hiding this comment.
🧪 Thanks @Adam-Schildkraut! Pinning every chat.postMessage field to exactly one occurrence is a nice way to guard this, and it fails on the old double insert.
Left a couple of comments 💯
- : 💯 praise: Nice catch, this duplicate has been riding along since 2019. The call that stays has the same null guard, so this is a clean fix with no behavior change for anyone 🙏
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1684 +/- ##
============================================
+ Coverage 74.03% 75.72% +1.69%
- Complexity 4758 4856 +98
============================================
Files 487 487
Lines 14811 14810 -1
Branches 1536 1536
============================================
+ Hits 10965 11215 +250
+ Misses 2934 2753 -181
+ Partials 912 842 -70
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
|
🔭 question: Thanks for finding this duplicate! Could this be solved more generically in |
|
hey @WilliamBergamin! thanks, good catch 😄 i’ve added that assert, so the test now checks that |
|
heya @zimeg!! i took your broader-test suggestion and pushed it! so the existing RequestFormBuilderTest now checks every |
|
@Adam-Schildkraut could you resolve the merge conflict once addressed I can give this another review 🙏 |
|
@WilliamBergamin fixed! |
|
@WilliamBergamin just brought this back up to date if you have time to review this week :) |
When
chat.postMessageis given a thread timestamp, the SDK addsthread_tsto the form body twice. Both entries contain the same value, but clients inspecting the request can fail when they expect one value per field.The field is already added earlier in the same method. This removes the second insertion. The test checks that each expected field in a populated message form appears exactly once, regardless of order. It fails before the fix and passes afterwards.
Validation:
RequestFormBuilderTestand the localChatTestsuite on Java 17.Category (place an
xin each of the[ ])Requirements
Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you agree to those rules.