Repository navigation
Closed
Labels
bugConfirmed bugs or reports that are very likely to be bugshelp wantedIssues marked as ideal for external contributorspriority-3Bugs that affect small number of users and/or relatively cosmetic in nature
Description
Description
Sometimes, when making a commit, the Summary line is not cleared after commit. The app ends up like this:
The commit has gone through but the summary is still there. I reported this a while back via email but it still happens occasionally.
This seems to happen on occasions when my laptop is running slowly. Usually I've switched to another app while the commit is happening. But when I switch back, the Summary line is there.
Version
GitHub Desktop version: 1.0.13
OS version: macOS High Sierra 10.13.3
Steps to Reproduce
- Write a commit summary.
- Click "Commit to master".
- Switch to another app.
- Switch back after a few seconds.
Logs
Here's the log from around the time the commit was made:
2018-02-19T16:27:05.970Z - info: [ui] Executing getBranches: git for-each-ref --format=%(refname)%00%(refname:short)%00%(upstream:short)%00%(objectname)%00%(author)%00%(committer)%00%(parent)%00%(symref)%00%(subject)%00%(body)%00%(trailers:unfold,only)%00%1F refs/heads refs/remotes (took 1.034s)
2018-02-19T16:27:18.902Z - info: [ui] Executing getPartialBlobContents: git show 2416b854c041a315d22991b67eb9e2eb64de850c^:FILE (took 1.147s)
2018-02-19T16:27:20.234Z - info: [ui] Executing getCommits: git log HEAD --date=raw --max-count=100 --pretty=%H%x1F%s%x1F%b%x1F%an <%ae> %ad%x1F%cn <%ce> %cd%x1F%P%x1F%(trailers:unfold,only) -z --no-color --not --remotes -- (took 2.535s)
2018-02-19T16:27:22.228Z - info: [ui] Executing getPartialBlobContents: git show HEAD:FILE (took 1.105s)
2018-02-19T16:27:26.382Z - info: [ui] Executing unstageAll: git reset -- . (took 29.270s)
2018-02-19T16:27:29.557Z - info: [ui] Executing getRecentBranches: git log -g --no-abbrev-commit --pretty=oneline HEAD -n 2500 -- (took 12.745s)
2018-02-19T16:27:29.561Z - info: [ui] Executing getRecentBranches: git log -g --no-abbrev-commit --pretty=oneline HEAD -n 2500 -- (took 24.590s)
2018-02-19T16:27:29.564Z - info: [ui] Executing getRecentBranches: git log -g --no-abbrev-commit --pretty=oneline HEAD -n 2500 -- (took 21.262s)
2018-02-19T16:27:29.572Z - info: [ui] Executing updateIndex: git update-index --add --remove --replace -z --stdin (took 3.189s)
2018-02-19T16:27:33.398Z - info: [ui] Executing getStatus: git status --untracked-files=all --branch --porcelain=2 -z (took 12.327s)
2018-02-19T16:27:33.407Z - info: [ui] Executing getStatus: git status --untracked-files=all --branch --porcelain=2 -z (took 28.518s)
2018-02-19T16:27:33.479Z - info: [ui] Executing getStatus: git status --untracked-files=all --branch --porcelain=2 -z (took 25.187s)
2018-02-19T16:27:33.499Z - info: [ui] Executing getStatus: git status --untracked-files=all --branch --porcelain=2 -z (took 16.700s)
2018-02-19T16:27:35.414Z - info: [ui] Executing createCommit: git commit -F - (took 5.842s)
Reacted by Jed Fox, Shoshin Nikita, lilgurl, Andrii Vitiv and Samuel Roland
Metadata
Metadata
Assignees
Labels
bugConfirmed bugs or reports that are very likely to be bugshelp wantedIssues marked as ideal for external contributorspriority-3Bugs that affect small number of users and/or relatively cosmetic in nature

Activity
shiftkey commentedon Apr 9, 2018
A few attempts at recreating this and I haven't been able to trigger it, but the area of code to focus on is here:
desktop/app/src/ui/changes/commit-message.tsx
Lines 255 to 263 in 2dfc68a
In theory we should only be clearing the commit form when the commit is successful, and logs don't suggest an error is occurring when committing, but maybe there's some detail that I've not caught yet.
I'll also point out that there's several
getStatuscalls that occur in between staging and committing, each taking significantly long to complete, and this might be part of the repro:mcmonkey4eva commentedon Jun 8, 2018
I've had this happen a lot, whenever GitHub Desktop is lagging (not my PC lagging, GitHub Desktop lagging. Not sure where that discussion goes but will throw it into #4290 and move if requested).
I'm running on release version 1.2.3 of GitHub Desktop (current as of post time) + Windows 10 Home (not sure about Win10 version code, but the current one for start of June 2018)
As far as recreation, my best guess as to a good way would be to manually induce lag in the app while making a commit. Possibly intentionally modify the git calls to take much longer than needed.
kdorsel commentedon Jun 11, 2018
I just got the same behavior. GitHub Desktop was indeed lagging significantly also. I'm on windows 7 running 1.2.3.
It took 1-2 seconds after clicking commit for the pull/push button to update showing there's a commit to push.
Looking under history it took 3-5 seconds for the commit to show up. I was able to switch back and forth from it a few times before it showed.
Both the Summary and Description were not cleared.
I created a test branch and tried committing a few more, there's a ~7s delay before the summary gets cleared and the commit callbacks finish, but it works now. This was done before a restart. Restarting the client yields the same results.
svivian commentedon Jul 20, 2018
OK I've found one way to reproduce this.
The summary I typed is still there. I'm not sure if this is the only way, I think in the past I've pressed the commit button and switched to another app, maybe that has the same effect (Github Desktop is not active to the field is not cleared).
shiftkey commentedon Jul 20, 2018
I think I know what this is, and it's due to two things:
CommitMessagedoesn't signal to theAppStoreto clear the commit message (it just does asetStateinternally to clear the form)CommitMessagemeans the state isn't cleared, and when you return to it you'll inherit whatever was in theAppStore(aka your previous commit)I've opened #5208 which should be the right fix
shiftkey commentedon Jul 27, 2018
Reopening this because it's not as simple a fix as I'd hoped
StefKors commentedon Feb 14, 2019
I'm having a similar issue, where after the inactive state is removed it takes a couple seconds before the input is cleared.
Perhaps it's possible to clear the input immediately after the inactive state is removed?
steveward commentedon Mar 11, 2019
Reported in #7061 by @AlcaDesign:
shiftkey commentedon Jun 14, 2019
Reported in #7801 by @kkocdko (same steps to reproduce as #4046 (comment))
terreng commentedon Jul 25, 2019
Here's a GIF:
StefKors commentedon Jul 26, 2019
I think clearing the input earlier or creating a loading state will solve this issue
samuelko123 commentedon Apr 23, 2023
Hi @shiftkey, I would like to help on this issue.
I read from #5269 that you want to build some automated tests around the code, but I couldn't find many front-end tests in the repo other than
app-test.tsx. I believe we can use tools like Testing Library to render theApp, simulate keyboard and mouse events, then assert front-end visual results. Currently, runningapp-test.tsxtakes 7.5s on my laptop. It wouldn't be too bad if we're to create another one.In terms of the fix itself:
Problem 1 - Message persisted when it shouldn't
Solution 1 - Clear the message at the start of commit
Problem 2 - If we clear the message, it will be lost if commit is not successful
Solution 2 - Add
previousCommitMessageto the store per repo, and create a button with an undo icon plus tooltip "restore previous message", so user can restore the lost messageI'm happy to help with both building the tests and the fix.
Hope it makes sense.
shiftkey commentedon Apr 23, 2023
@samuelko123 I'm no longer involved with this project so I'm not sure what the recommended approach is for this currently, but otherwise feel free to take a shot at fixing this bug...
svivian commentedon Apr 23, 2023
I haven’t experienced this bug for years, so it must have been fixed a while back.
samuelko123 commentedon Apr 23, 2023
@shiftkey Thanks for letting me know. I'll wait for the maintainers then.
@svivian The bug still exists today. Maybe commit becomes quicker these days, so it's harder to encounter. Anyway, let's see whether someone else would raise the same bug again.