Repository navigation
fix: send thread_ts once in chat.postMessage requests - #1684
Adam-Schildkraut wants to merge 5 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 73.75% 73.75% -0.01%
- Complexity 4679 4682 +3
============================================
Files 487 487
Lines 14669 14668 -1
Branches 1528 1528
============================================
- Hits 10819 10818 -1
- Misses 2939 2942 +3
+ Partials 911 908 -3
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! |
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.