jesseduffield.lazygit/pkg
Stefan Haller d274474c61 Band-aid fix for rare crashes when refreshing files
Users have filed issues with crash reports that seem to indicate that the
FileTreeViewModel gets swapped out (by a refresh) while a call to itemsSelected
is in progress, iterating over the previous items. Guard against this by locking
the mutex that we already have for this for the duration of the call.

I don't have a good way of testing whether the fix helps, because the crashes
only occurred very infrequently. Let's just see if the crash reports stop coming
in after we ship this.

Note also that this is only the minimal fix for the crashes that were reported.
Theoretically, the same problem could happen for a key handler itself, but we
never saw reports about that, so we don't bother doing anything about that yet.

Note also that long-term I envision a different solution to this class of
problems (discussed in https://github.com/jesseduffield/lazygit/issues/2974),
that's why I want to avoid locking mutexes more than necessary now.
2025-12-03 08:08:21 +01:00
..
app Show a better error message if the temp directory is not writeable 2025-10-16 10:04:47 +02:00
cheatsheet Update generators to change the files in the -master directories 2025-11-12 08:44:56 +01:00
commands Remove unused function GetHashesAndCommitMessagesFirstLine 2025-11-30 14:06:31 +01:00
common Move NewDummyCommon to pkg/common 2025-05-06 09:43:26 +02:00
config Add methods for converting RefresherConfig times to time.Durations 2025-11-16 17:32:37 +01:00
constants Make the links in the status panel point to the current version rather than master 2024-03-22 08:13:59 +01:00
env Support bare worktrees where worktree does not have its own .git file 2023-08-07 22:40:53 +10:00
fakes Modernize all codes 2025-11-15 10:46:23 +01:00
gui Band-aid fix for rare crashes when refreshing files 2025-12-03 08:08:21 +01:00
i18n feat: add fork remote command 2025-11-16 17:26:00 +01:00
integration Fix order of fixup base commits shown in ctrl-f error message 2025-11-30 14:06:31 +01:00
jsonschema Modernize all codes 2025-11-15 10:46:23 +01:00
logs Clean up build tags 2025-08-14 20:40:44 +02:00
snake Enable intrange linter, and fix warnings 2025-06-30 18:30:11 +02:00
tasks Modernize all codes 2025-11-15 10:46:23 +01:00
theme Highlight inactive selection in bold 2024-06-23 14:43:13 +02:00
updates Change direct access to Common.UserConfig to a getter 2024-08-18 10:24:52 +02:00
utils Modernize all codes 2025-11-15 10:46:23 +01:00