diff options
Diffstat (limited to 'internal/processing/workers/fromclientapi.go')
| -rw-r--r-- | internal/processing/workers/fromclientapi.go | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/internal/processing/workers/fromclientapi.go b/internal/processing/workers/fromclientapi.go index 5d9ebf41a..04ad4152c 100644 --- a/internal/processing/workers/fromclientapi.go +++ b/internal/processing/workers/fromclientapi.go @@ -748,10 +748,17 @@ func (p *clientAPI) UpdateStatus(ctx context.Context, cMsg *messages.FromClientA } } - // Notify of the latest edit. - if editsLen := len(status.EditIDs); editsLen != 0 { - editID := status.EditIDs[editsLen-1] - if err := p.surface.notifyStatusEdit(ctx, status, editID); err != nil { + if len(status.EditIDs) > 0 { + // Ensure edits are fully populated for this status before anything. + if err := p.surface.State.DB.PopulateStatusEdits(ctx, status); err != nil { + log.Error(ctx, "error populating updated status edits: %v") + + // Then send notifications of a status edit + // to any local interactors of the status. + } else if err := p.surface.notifyStatusEdit(ctx, + status, + status.Edits[len(status.Edits)-1], // latest + ); err != nil { log.Errorf(ctx, "error notifying status edit: %v", err) } } |
