HomePhabricator
Diffusion Comm a77e7bf193ca

[web/native/lib] Use message pruner on web

Description

[web/native/lib] Use message pruner on web

Summary:
ENG-3475 : Implement message pruner for the web
Now that messages will be persisted on web we should prun them occasionaly. This moves MessageStorePruner, nextMessagePruneTimeSelector and pruneThreadIDsSelector from native to lib and removes the platform-specific code, which now lives in native/web.

Also fixes an issue mentioned in this comment by ignoring threads with less than 20 messages in nextMessagePruneTimeSelector.

Depends on D11544

Test Plan: Change the msInHour constant to a lower value so pruning happens more often. Test on both web and native that the threads with <20 messages get pruned. Test that this doesn't cause issues on web (e.g. the messages can still be fetched from keyserver).

Reviewers: atul, kamil, marcin

Reviewed By: atul, kamil

Subscribers: ashoat, tomek

Differential Revision: https://phab.comm.dev/D11545

Details

Provenance
Michal Gniadek <michal.gniadek@swmansion.com>Authored on Apr 2 2024, 8:40 AM
Reviewer
atul
Differential Revision
D11545: [web/native/lib] Use message pruner on web
Parents
rCOMM9705de4522f9: [web] Clear database on non-threadStore ops fail
Branches
Unknown
Tags
Unknown

Event Timeline