Skip to content

Conversation

@sina-hide
Copy link
Contributor

Due to a race condition it was possible, that there were changes (the badge for LOCAL CHANGES showed a non-zero number), but there were no staged or unstaged files shown.

The problem was, that while loading the changes for the first time, the watcher could start the loading a second time. The first loading was cancelled, but it could have already set the first instance variable. Therefore, on the second load a shortcut was done, since there was seemingly no change.

Due to a race condition it was possible, that there were changes (the
badge for LOCAL CHANGES showed a non-zero number), but there were no
staged or unstaged files shown.

The problem was, that while loading the changes for the first time, the
watcher could start the loading a second time.  The first loading was
cancelled, but it could have already set the first instance variable. 
Therefore, on the second load a shortcut was done, since there was
seemingly no change.
@love-linger love-linger self-assigned this Jan 5, 2026
@love-linger love-linger added the bug Something isn't working label Jan 5, 2026
@love-linger love-linger merged commit 42db2b1 into sourcegit-scm:develop Jan 5, 2026
14 checks passed
love-linger added a commit that referenced this pull request Jan 5, 2026
The latest change collection should be passed to `GetStagedChange`

Signed-off-by: leo <longshuang@msn.cn>
@sina-hide sina-hide deleted the set-data-race-condition branch January 5, 2026 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants