test(outbound): pin chunked thread-reply behavior (issue #5) - #17
Open
Xuxchloris wants to merge 1 commit into
Open
test(outbound): pin chunked thread-reply behavior (issue #5)#17Xuxchloris wants to merge 1 commit into
Xuxchloris wants to merge 1 commit into
Conversation
The fix for larksuite#5 (every chunk of a long reply must reply to the root when reply_in_thread=True, otherwise chunks after the first leak out of the thread) is already in main but had no regression coverage. Add two tests to test_sender.py: - thread reply: all 3 chunks go through reply_message to the root with reply_in_thread=True; - flat reply: only the first chunk quote-replies; the rest are fresh creates (legacy behavior preserved). 12/12 tests pass in the sender suite.
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.
References #5.
Context
The root cause described in #5 (a long threaded reply loses
reply_toon chunks after the first, so the tail leaks out of the topic thread into the main timeline) is already fixed in main —OutboundSender.send()keepseffective_reply_toon every chunk whenreply_in_thread=True:What was missing is regression coverage pinning that behavior (and the legacy flat-reply behavior), which is why the issue stayed open.
Change
Add two tests to
lark_channel/channel/tests/test_sender.py:test_thread_reply_every_chunk_replies_to_root: withreply_in_thread=True, a 25-char text chunked into 3 parts produces 3reply_messagecalls, all to the same root withreply_in_thread=True— no chunk leaks to the main timeline.test_flat_reply_only_first_chunk_quotes_parent: legacy flat-reply contract stays intact — only the first chunk quote-replies, the rest are freshcreate_messagecalls.Verification
python -m pytest lark_channel/channel/tests/test_sender.py— 12/12 pass.