search: Include history for is:resolved queries.

The previous logic assumed that all `is:` operators were those like `is:muted`
or `is:starred`, which depend on personal data.
This commit is contained in:
Kenneth Rodrigues 2024-05-21 03:07:08 +05:30 committed by GitHub
parent ffb182fb25
commit ba92cd8b23
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -903,7 +903,7 @@ def ok_to_include_history(
# that's a property on the UserMessage table. There cannot be
# historical messages in these cases anyway.
for term in narrow:
if term["operator"] == "is":
if term["operator"] == "is" and term["operand"] not in {"resolved"}:
include_history = False
return include_history

View File

@ -1103,7 +1103,7 @@ class IncludeHistoryTest(ZulipTestCase):
dict(operator="channels", operand="public"),
dict(operator="is", operand="resolved"),
]
self.assertFalse(ok_to_include_history(narrow, user_profile, False))
self.assertTrue(ok_to_include_history(narrow, user_profile, False))
# simple True case
narrow = [