~sircmpwn/aerc2#499: 
data race after failing to create message outside Draft mailbox

hi,

I am using aerc at 548faca, and compiled with -race. I sometimes get:

5B9mcA NO cannot create messages outside the Drafts mailbox
2021/03/10 11:48:53 ->(ui) *types.Error:*types.AppendMessage
2021/03/10 11:48:53 (ui)<= *types.Error(123):*types.AppendMessage(122)
==================
WARNING: DATA RACE
Read at 0x00c000182318 by main goroutine:
  git.sr.ht/~sircmpwn/aerc/worker/types.(*Worker).ProcessMessage()
      git.sr.ht/~sircmpwn/aerc/worker/types/worker.go:81 +0x364
  git.sr.ht/~sircmpwn/aerc/widgets.(*AccountView).Tick()
      git.sr.ht/~sircmpwn/aerc/widgets/account.go:100 +0xfd
  git.sr.ht/~sircmpwn/aerc/widgets.(*Aerc).Tick()
      git.sr.ht/~sircmpwn/aerc/widgets/aerc.go:139 +0xe4
  main.main()
      git.sr.ht/~sircmpwn/aerc/aerc.go:194 +0xc0f

Previous write at 0x00c000182318 by goroutine 79:
  git.sr.ht/~sircmpwn/aerc/worker/types.(*Worker).PostAction()
      git.sr.ht/~sircmpwn/aerc/worker/types/worker.go:52 +0x2a4
  git.sr.ht/~sircmpwn/aerc/commands/compose.copyToSent()
      git.sr.ht/~sircmpwn/aerc/commands/compose/send.go:416 +0x2aa
  git.sr.ht/~sircmpwn/aerc/commands/compose.Send.Execute.func2()
      git.sr.ht/~sircmpwn/aerc/commands/compose/send.go:142 +0x356

Goroutine 79 (running) created at:
  git.sr.ht/~sircmpwn/aerc/commands/compose.Send.Execute()
      git.sr.ht/~sircmpwn/aerc/commands/compose/send.go:133 +0xd04
  git.sr.ht/~sircmpwn/aerc/commands/compose.(*Send).Execute()
      <autogenerated>:1 +0x6f
  git.sr.ht/~sircmpwn/aerc/commands.(*Commands).ExecuteCommand()
      git.sr.ht/~sircmpwn/aerc/commands/commands.go:66 +0x197
  main.execCommand()
      git.sr.ht/~sircmpwn/aerc/aerc.go:61 +0x285
  main.main.func2()
      git.sr.ht/~sircmpwn/aerc/aerc.go:160 +0xa9
  git.sr.ht/~sircmpwn/aerc/widgets.(*Aerc).BeginExCommand.func1()
      git.sr.ht/~sircmpwn/aerc/widgets/aerc.go:434 +0xc8
  git.sr.ht/~sircmpwn/aerc/widgets.(*ExLine).Event()
      git.sr.ht/~sircmpwn/aerc/widgets/exline.go:81 +0x25a
  git.sr.ht/~sircmpwn/aerc/widgets.(*Aerc).Event()
      git.sr.ht/~sircmpwn/aerc/widgets/aerc.go:225 +0xa02
  git.sr.ht/~sircmpwn/aerc/widgets.(*Aerc).simulate()
      git.sr.ht/~sircmpwn/aerc/widgets/aerc.go:214 +0x124
  git.sr.ht/~sircmpwn/aerc/widgets.(*Aerc).Event()
      git.sr.ht/~sircmpwn/aerc/widgets/aerc.go:241 +0x936
  git.sr.ht/~sircmpwn/aerc/lib/ui.(*UI).Tick()
      git.sr.ht/~sircmpwn/aerc/lib/ui/ui.go:98 +0x2f1
  main.main()
      git.sr.ht/~sircmpwn/aerc/aerc.go:197 +0xc3b
==================
2021/03/10 11:48:53 cannot create messages outside the Drafts mailbox
==================
WARNING: DATA RACE
Read at 0x00c000001e10 by goroutine 79:
  git.sr.ht/~sircmpwn/aerc/widgets.(*StatusLine).Push()
      git.sr.ht/~sircmpwn/aerc/widgets/status.go:79 +0x1f8
  git.sr.ht/~sircmpwn/aerc/widgets.(*StatusLine).PushError()
      git.sr.ht/~sircmpwn/aerc/widgets/status.go:95 +0x7e
  git.sr.ht/~sircmpwn/aerc/widgets.(*Aerc).PushError()
      git.sr.ht/~sircmpwn/aerc/widgets/aerc.go:399 +0x559
  git.sr.ht/~sircmpwn/aerc/commands/compose.Send.Execute.func2()
      git.sr.ht/~sircmpwn/aerc/commands/compose/send.go:149 +0x51c

Previous write at 0x00c000001e10 by main goroutine:
  git.sr.ht/~sircmpwn/aerc/widgets.(*StatusLine).Push()
      git.sr.ht/~sircmpwn/aerc/widgets/status.go:79 +0x27b
  git.sr.ht/~sircmpwn/aerc/widgets.(*StatusLine).PushError()
      git.sr.ht/~sircmpwn/aerc/widgets/status.go:95 +0x7e
  git.sr.ht/~sircmpwn/aerc/widgets.(*Aerc).PushError()
      git.sr.ht/~sircmpwn/aerc/widgets/aerc.go:399 +0x639
  git.sr.ht/~sircmpwn/aerc/widgets.(*AccountView).onMessage()
      git.sr.ht/~sircmpwn/aerc/widgets/account.go:282 +0x50f
  git.sr.ht/~sircmpwn/aerc/widgets.(*AccountView).Tick()
      git.sr.ht/~sircmpwn/aerc/widgets/account.go:101 +0x124
  git.sr.ht/~sircmpwn/aerc/widgets.(*Aerc).Tick()
      git.sr.ht/~sircmpwn/aerc/widgets/aerc.go:139 +0xe4
  main.main()
      git.sr.ht/~sircmpwn/aerc/aerc.go:194 +0xc0f

Goroutine 79 (running) created at:
  git.sr.ht/~sircmpwn/aerc/commands/compose.Send.Execute()
      git.sr.ht/~sircmpwn/aerc/commands/compose/send.go:133 +0xd04
  git.sr.ht/~sircmpwn/aerc/commands/compose.(*Send).Execute()
      <autogenerated>:1 +0x6f
  git.sr.ht/~sircmpwn/aerc/commands.(*Commands).ExecuteCommand()
      git.sr.ht/~sircmpwn/aerc/commands/commands.go:66 +0x197
  main.execCommand()
      git.sr.ht/~sircmpwn/aerc/aerc.go:61 +0x285
  main.main.func2()
      git.sr.ht/~sircmpwn/aerc/aerc.go:160 +0xa9
  git.sr.ht/~sircmpwn/aerc/widgets.(*Aerc).BeginExCommand.func1()
      git.sr.ht/~sircmpwn/aerc/widgets/aerc.go:434 +0xc8
  git.sr.ht/~sircmpwn/aerc/widgets.(*ExLine).Event()
      git.sr.ht/~sircmpwn/aerc/widgets/exline.go:81 +0x25a
  git.sr.ht/~sircmpwn/aerc/widgets.(*Aerc).Event()
      git.sr.ht/~sircmpwn/aerc/widgets/aerc.go:225 +0xa02
  git.sr.ht/~sircmpwn/aerc/widgets.(*Aerc).simulate()
      git.sr.ht/~sircmpwn/aerc/widgets/aerc.go:214 +0x124
  git.sr.ht/~sircmpwn/aerc/widgets.(*Aerc).Event()
      git.sr.ht/~sircmpwn/aerc/widgets/aerc.go:241 +0x936
  git.sr.ht/~sircmpwn/aerc/lib/ui.(*UI).Tick()
      git.sr.ht/~sircmpwn/aerc/lib/ui/ui.go:98 +0x2f1
  main.main()
      git.sr.ht/~sircmpwn/aerc/aerc.go:197 +0xc3b
==================
Status
REPORTED
Submitter
~sbinet
Assigned to
No-one
Submitted
a month ago
Updated
a month ago
Labels
No labels applied.