Fix redelivery Issue #710 - #731
Open
mhelsley wants to merge 2 commits into
Open
Conversation
mhelsley
requested review from
aymanbagabas and
meowgorithm
and removed request for
a team
February 7, 2026 23:26
Author
|
This is an alternative to PR #726 . My apologies, I forgot to look for pre-existing PRs. This one has a test case in the first commit which may still be useful to merge even if the other PR is merged. |
added 2 commits
February 11, 2026 11:51
Reproduces Issue charmbracelet#710: Duplicate message forwarding in Group.Update Count the number of times a sent message is delivered to the same model instance and also count deliveries to a selected field using a custom field type. The assumption is a given message instance will not be delivered twice to the same selected field. This testcase shows that non-KeyMsg messages are delivered twice to a group's selected field: ❯ go test --- FAIL: TestCountMsgRedelivery (0.00s) group_test.go:207: INFO: Estimated 4 or more other type of tea.Msg deliveries to top level model got 5 group_test.go:250: Expected 1 testMsg deliveries to counter model got 2 When a subsequent fix is applied the testcase succeeds and produces no output -- it has verified that exactly one testMsg gets delivered to the selected field. Includes a sanity check using the Select Field in place of the custom Field that only counts the messages delivered at the top level of the model. It verifies that the messages sent by the testcase to the program are sufficient to manipulate a standard Field to produce a form result. This way if the test methodology ever becomes out-of-date it will be clear how to update it.
Fixes Issue charmbracelet#710 Duplicate message forwarding in Group.Update Non-KeyMsg are passed into Update twice for the selected field. It happens in the default block first then, after exiting the switch, inside the index-guarded block. Now every field still receives non-Key messages but only the selected field receives KeyMsg Refs: Issue charmbracelet#710
mhelsley
force-pushed
the
fix-redelivery
branch
from
February 11, 2026 19:51
bdfca84 to
eb7c329
Compare
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.
I believe these two commits are ready for review. The first creates a test which reproduces the reported issue and the second fixes it.
If I understand the below correctly, since this isn't a new feature it is not necessary to contact a maintainer before submitting this PR.
CONTRIBUTING.md.