Closed tsmethurst closed 1 year ago
this will be a race condition with multiple codepaths going down the same path of enriching a new account model I'm pretty sure. I have an idea of how to fix this though I'm hesitant as without a deep dive into how the go-fed/activity library is using the per URI locking we could end up deadlocking against that. I'll have to take a deeper look when I next get a chance.
a cheap fix for now would be to just do if errors.Is(err, db.ErrAlreadyExists()
on the new account route (i.e. account.CreatedAt.IsZero()
) and in that case do a re-fetch from database for the newly stored item.
it's not the neatest method and means we could be doing multiple derefs for things at a time, but it would work for now.
Seeing a few of these bad boys logged with no apparent cause, this issue is a stub to remind myself (or someone else) to investigate it, we're probably dropping messages because of it.