Skip to content

Comment counts are out of sync with comment view while record is pending #257

@tom-sherman

Description

@tom-sherman

Describe the bug

Comment count says 1, but no comment appears. This is because the record is pending and our aggregate rows don't take this into account.

To Reproduce

  1. Revoke access to frontpage at https://bsky.social/account (this is the easiest way to get record writes to fail)
  2. Make a comment

Now the post has +1 comment count but the comment doesn't show for anyone except the author.

Expected behavior

Comment count to be consistent with comment thread view.

This is pretty hard to do for both the comment author and everyone else (would require keeping track of multiple counts, or discarding our aggregate system altogether for something else). So I suggest we fix by having the count reflective of live comments only, not pending ones.

Screenshots

Image

Additional context

The fix here involves moving the create comment trigger into the receive hook ie. after we receive the record back from the relay. We should move all triggers to the receive hook as this makes more sense architecturally.

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions