noyainrain / listling

Web app to make and edit lists collaboratively.
https://listling.org/
GNU Affero General Public License v3.0
34 stars 8 forks source link

Fix wrong list features type #105

Closed noyainrain closed 3 years ago

noyainrain commented 3 years ago

An empty List.features array is wrongly represented as an object, after update_value_summary().

Test case to reproduce:

async def test_edit_no_features(self) -> None:
    self.app.r.caching = False
    await self.list.edit()
    lst = self.app.lists[self.list.id]
    self.assertEqual(lst.features, [])

This is caused by Lua CJSON not differentiating between empty objects and arrays.