New information: this appears to be a race condition happening. If I add the following to my append method then all the data is stored and retrieved:
time.Sleep(10 * time.Millisecond)
I hate having random “sleep” calls in my code, because the “fix” is fragile and in the right conditions it will happen again. The real question then is what is the correct thing for me to do to ensure that the write is complete?