From cd75825c0a8452107cd926f5ec50fda61bbc934a Mon Sep 17 00:00:00 2001 From: Jesse Hallett Date: Wed, 31 Jul 2019 14:00:33 -0400 Subject: [PATCH] fix: search should include most recent results if results are truncated --- packages/main/src/sync.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/main/src/sync.ts b/packages/main/src/sync.ts index 2cfdb85b..2001b8a5 100644 --- a/packages/main/src/sync.ts +++ b/packages/main/src/sync.ts @@ -94,8 +94,10 @@ class BoxSync { ) .toPromise() ) + // Returned uids appear to be in ascending order, which should mean that + // the most recent search results are at the end of the list. + .slice(0 - MAX_SEARCH_RESULTS) .map(uid => parseInt(uid, 10)) - .take(MAX_SEARCH_RESULTS) // Add messages that have already been downloaded to result set cache.addSearchResults({