Repository navigation
fix(native): send a pull request's review comments to its own session - #913
Merged
Merged
Conversation
The Files tab in Pulls bound its comment batch and line injects to the window's active session and keyed the batch by that session's checkout, so Send typed a pull request's comments into whichever session was open before Pulls, reviewing another branch. reviewSession now picks a session in the checkout of the pull request's head branch: the active one when it sits there, the first otherwise. With none, Send refuses and keeps the batch. A branch with no checkout keeps its batch under the pull request's page, and the comments move into the checkout once Open in Session creates it.
3 tasks done
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.
Summary
On the Pulls screen, Send on a pull request's "Comments for the session" batch typed the comments into whichever session was active before Pulls opened, with no check that it was working on that pull request's branch. The Files tab took
inject/submitbound to the window's active session (main.go) and keyed the batch by that session's checkout.pullsScreen.reviewSession(d)picks where the pull request's comments go: a session in the checkout of its head branch, the active one when it sits there, the first otherwise. The window's active session in another checkout is never picked.commentStore.movecarries the comments over, so nothing written before is lost.filesInputnow carries the active session id and theinjector/submitterfactories instead of functions bound to the active session;sessionButtonreadsreviewSession.stale_pulls_test.go: the rig now wiressessionsInandfilesthe waymain.godoes (it used to rely on a nil guard the old hook had); no assertion changed.CHANGELOG.md[Unreleased]› Fixed entry.Test plan
native/:gofmt -l .clean,go vet ./...andgo test ./...greenTestPullRequestCommentsGoOnlyToASessionInItsBranchCheckout: branch checked out, active session inside and outside it, branch with no checkoutTestCommentBatchMovesWholeAfterWhatItJoins: the batch moves after what the checkout already holds, an open edit follows it