Page MenuHomePhabricator

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

Authored by michal on Wed, Apr 3, 7:40 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Apr 16, 11:03 AM
Unknown Object (File)
Mon, Apr 15, 8:08 PM
Unknown Object (File)
Thu, Apr 11, 8:12 AM
Unknown Object (File)
Wed, Apr 10, 2:31 PM
Unknown Object (File)
Tue, Apr 9, 10:02 PM
Unknown Object (File)
Mon, Apr 8, 7:26 PM
Unknown Object (File)
Mon, Apr 8, 7:26 PM
Unknown Object (File)
Mon, Apr 8, 2:19 PM
Subscribers

Details

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).

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

michal requested review of this revision.Wed, Apr 3, 7:55 AM
atul retitled this revision from [web/native/lib] Use message prunner on web to [web/native/lib] Use message pruner on web.
This revision is now accepted and ready to land.Thu, Apr 4, 12:18 PM
lib/selectors/message-selector.js
26–32 ↗(On Diff #38735)

Context for this here

kamil added inline comments.
lib/selectors/message-selector.js
6–7 ↗(On Diff #38735)

can be merged