fix: broken test after sorted-lists logic change

This commit is contained in:
Julian Lam
2021-02-01 14:51:16 -05:00
parent d5d24594e8
commit d6f60f4502
2 changed files with 5 additions and 6 deletions

View File

@@ -58,10 +58,9 @@ Settings.set = async function (hash, values, quiet) {
const sortedLists = Object.keys(sortedListData);
if (sortedLists.length) {
await db.setAdd('settings:' + hash + ':sorted-lists', sortedLists);
// Remove provided (but empty) sorted lists from the hash set
await db.setRemove('settings:' + hash + ':sorted-lists', sortedLists.filter(list => !sortedListData[list].length));
await db.setAdd('settings:' + hash + ':sorted-lists', sortedLists);
await Promise.all(sortedLists.map(async function (list) {
const numItems = await db.sortedSetCard('settings:' + hash + ':sorted-list:' + list);