Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

GO-4727 local counters for chat #2039

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

requilence
Copy link
Contributor

  • added read field to the message model. Set it based on author
  • ChatReadMessages RPC

TODO:

  • fill ChatState event
  • calculate and save heads

@requilence requilence marked this pull request as draft January 23, 2025 10:24
@deff7 deff7 changed the base branch from main to GO-4146-new-spacestore January 28, 2025 12:21
@requilence requilence force-pushed the go-4727-local-counters-for-chat branch from 283d66c to a1c97db Compare January 30, 2025 15:15
oldestOrderId = doc.Value().GetObject(orderKey).Get("id").GetString()
}

count, err := unreadQuery.Count(ctx)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like count is 0 or 1 because of limit=1

}

// mark the whole tree as seen from the current message
s.storeSource.MarkSeenHeads([]string{msg.Id})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed there should be many messages, not one marked as head, because otherwise we will miss some read messages. Pls change it

// for testing purposes
lastAddedMessageTimestamp = math.MaxInt64
}
iter, err := coll.Find(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also add filter for unread messages?

Base automatically changed from GO-4146-new-spacestore to main February 13, 2025 14:24
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants