Skip to content

Conversation

Arsnael
Copy link
Contributor

@Arsnael Arsnael commented Aug 29, 2025

Still left Cassandra and Postgresql implem finalizing

Copy link
Member

@quantranhong1999 quantranhong1999 left a comment

Choose a reason for hiding this comment

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

Read it. This seems to be going in the right direction to me.

public Flux<MessageId> listMailboxContentSortedBySentAt(MailboxId mailboxId, Limit limit, boolean collapseThreads) {
Preconditions.checkArgument(!limit.isUnlimited(), "Limit should be defined");

Limit limitFetch = defineLimitFetch(limit, collapseThreads);
Copy link
Contributor Author

@Arsnael Arsnael Sep 3, 2025

Choose a reason for hiding this comment

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

Cassandra is defo trickier :)

I'm not sure here...
I've been thinking quite a lot, this is a proposition among others. I feel like looping on cassandra requests until we meet the limit for collapseThreads would complexify greatly the code and for not such a great gain (more costly in perf too).

I thought:

  • or we do like some requests that need to be post-sorted, just fetch all records, then collapsing threads and take the limit
  • or we fetch an upper limit (here 3 times the limit defined) and we collapse threads and then take up to the limit. We accept that maybe sometimes we could have a bit less than the limit (hopefully rare enough) but it should stay balanced in terms of perf and keep the code relatively simple.

I tried to look at paging too but that would complexify a lot the code as well I believe (like looping).

Well brain storming welcomed honestly

Copy link
Contributor

Choose a reason for hiding this comment

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

I can get a try to the cassandra implem but yes we would need some extra work for Cassandra.

However can we focus on the short term on SaaS related topis?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants