Closed insipx closed 3 weeks ago
Good find
The easiest solution is to rely on the fact that sequence_id
is actually globally unique. So, it would work to just do a query with sequence_id = ANY(sequence_ids)
and ignore inbox_id
. We've been trying not to rely on this global uniqueness because it makes it harder to change the backend. Maybe we want to do something with replication that takes away the global uniqueness later. But it's an option.
Maybe there are other SQLite query tricks to do a compound query like this. Or maybe we just break it into batches of 50.
Yeah, want to get #793 in so going to open it up without the populated group measurements then follow up on this afterwards
Fix was easier than I thought so it will just be part of 793
Describe the bug
During benchmarking I tried adding 5 members to a group that already had 100 members, but this fails when we try to load association state for members that already exist. Here are some logs that show the issue:
The function in question is
EncryptedStore::batch_read_from_cache
. I think we're reaching the maximum depth for subqueries, so we have to re-write this query to avoid thatFunction for convenience:
Expected behavior
we load association state for members which already exist
Steps to reproduce the bug