aboutsummaryrefslogtreecommitdiff
path: root/widgets/msglist.go
AgeCommit message (Collapse)Author
2019-04-29lib/msgstore: protect with a mutexSimon Ser
MessageStore has a lot of exported fields that can be read from the outside. Each read must be protected, because a call from Update could happen at any time.
2019-04-29widgets/msglist: fix MessageList.store raceSimon Ser
This field could be written to in the middle of a Draw call, which reads it multiple times. Use an atomic variable instead.
2019-04-27lib/ui: introduce InvalidatableSimon Ser
Many Drawable implementations have their own Invalidate and OnInvalidate functions, with an unexported onInvalidate field. However OnInvalidate and Invalidate are usually not called in the same goroutine. This results in a race on this field, e.g.: Read at 0x00c000094748 by goroutine 7: git.sr.ht/~sircmpwn/aerc2/widgets.NewDirectoryList.func1() /home/simon/src/aerc2/widgets/dirlist.go:85 +0x56 git.sr.ht/~sircmpwn/aerc2/widgets.(*Spinner).Start.func1() /home/simon/src/aerc2/widgets/spinner.go:93 +0x1bb Previous write at 0x00c000094748 by main goroutine: [failed to restore the stack] Goroutine 7 (running) created at: git.sr.ht/~sircmpwn/aerc2/widgets.(*Spinner).Start() /home/simon/src/aerc2/widgets/spinner.go:46 +0x8f git.sr.ht/~sircmpwn/aerc2/widgets.NewDirectoryList() /home/simon/src/aerc2/widgets/dirlist.go:37 +0x286 git.sr.ht/~sircmpwn/aerc2/widgets.NewAccountView() /home/simon/src/aerc2/widgets/account.go:50 +0x5ca git.sr.ht/~sircmpwn/aerc2/widgets.NewAerc() /home/simon/src/aerc2/widgets/aerc.go:60 +0x800 main.main() /home/simon/src/aerc2/aerc.go:65 +0x33e To fix this, introduce a new type, Invalidatable, which protects the field. Unfortunately the Drawable must be passed to the callback function in Invalidate, so we still need to re-implement this in each Invalidatable user.
2019-04-10Fix segfault on :view-message for unloaded messageTom Lebreux
This also fixes segfault on :view-message on empty directory Signed-off-by: Tom Lebreux <tomlebreux@cock.li>
2019-04-05Fix infinite loop on empty DirectoryContentsTom Lebreux
When changing to an empty directory, ml.selected is 0, and the length of ml.store.Uids is 0. The loop condition is always true so we have an infinite loop causing 100% CPU usage and prevents us to change to other directories. Signed-off-by: Tom Lebreux <tomlebreux@cock.li>
2019-04-04Show (no messages) for empty foldersDrew DeVault
2019-03-30Use tcell.Style.Reverse instead of black on whiteDrew DeVault
2019-03-30Show deleted emails pending server ack in greyDrew DeVault
TODO: Don't let the user select or interact with deleted messages
2019-03-29Add body fetching support codeDrew DeVault
2019-03-21Improve cursor handling in embedded terminalDrew DeVault
2019-03-20Implement :delete-messageDrew DeVault
2019-03-17Fix scrolling issues on :select-messageDrew DeVault
2019-03-15Implement :select-messageDrew DeVault
2019-03-15Implement scrolling in message listDrew DeVault
2019-03-15Implement :next-message n%Drew DeVault
2019-03-15Move MessageStore into its own fileDrew DeVault
2019-03-15Rig up key bindingsDrew DeVault
2019-03-14Implement :{next,prev}-messageDrew DeVault
2019-03-14Invalidate when UIDs finish downloadingDrew DeVault
2019-03-14Display message subjects in message listDrew DeVault
2019-03-14Implement message store side of message fetchingDrew DeVault
2019-03-14Lay out message list widget basic designDrew DeVault
2019-03-10Fetch valid UIDs from server after opening dirDrew DeVault