Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

has:image broken? #16118

Closed
xendk opened this issue Aug 12, 2020 · 2 comments
Closed

has:image broken? #16118

xendk opened this issue Aug 12, 2020 · 2 comments

Comments

@xendk
Copy link

xendk commented Aug 12, 2020

I've just discovered has:image and has:attachment. But in our own realm has:image gives me nothing, while a lot of images show up in has:attachment. On CZO has:imagegives me two messages, and again has:attachment gives me a lot of messages that I would say has an image.

I figure an image counts as an attachment, but images aren't properly detected.

@zulipbot
Copy link
Member

Hello @zulip/server-search members, this issue was labeled with the "area: search" label, so you may want to check it out!

@timabbott
Copy link
Sponsor Member

I can confirm this is broken. Some quick testing suggests the API is working (Network tab shows results) but the UI is blank, which suggests a web frontend bug.

sahil839 added a commit to sahil839/zulip that referenced this issue Aug 12, 2020
There was a bug where filtering using "has:image" does not show
any messages while filtering using "has:attachments" also include
messages with images.

This commit fixes the bug by changing message_util.message_has_image
to use 'hasClass' for checking if element with 'message_inline_image'
class exists or not instead of using find.

This change is done because '.find' searches for descendants of the
element, whereas in this case the '.message_inline_image' element is
not a descendant of a element in 'message.content', but it is one of
the elements of 'message.content'.

Fixes zulip#16118.
sahil839 added a commit to sahil839/zulip that referenced this issue Aug 12, 2020
There was a bug where filtering using "has:image" does not show
any messages while filtering using "has:attachments" includes
messages with images.

This commit fixes the bug by changing message_util.message_has_image
to use 'hasClass' for checking if element with 'message_inline_image'
class exists or not instead of using find.

This change is done because '.find' searches for descendants of the
element, whereas in this case the '.message_inline_image' element is
not a descendant of a element in 'message.content', but it is one of
the elements of 'message.content'.

Fixes zulip#16118.
thedeveloperr added a commit to thedeveloperr/zulip that referenced this issue Aug 12, 2020
This commit solves a bug due non working find() for a html element
which was not a descendant and fixes it by wrapping a virtual div
around the message content so that find works as intended in any
case whatsoever. This solution even protects from future cases of
html content or hierarchy changes.

Fixes zulip#16118.
thedeveloperr added a commit to thedeveloperr/zulip that referenced this issue Aug 12, 2020
This commit solves a bug due non working find() for a html element
which was not a descendant and fixes it by wrapping a virtual div
around the message content so that find works as intended in any
case whatsoever. This solution even protects from future cases of
html content or hierarchy changes.

Fixes zulip#16118.
thedeveloperr added a commit to thedeveloperr/zulip that referenced this issue Aug 13, 2020
This commit solves a bug due non working find() for a html element
which was not a descendant and fixes it by wrapping a virtual div
around the message content so that find works as intended in any
case whatsoever. This solution even protects from future cases of
html content or hierarchy changes.

Fixes zulip#16118.
timabbott pushed a commit that referenced this issue Aug 13, 2020
This commit solves a bug due non working find() for a html element
which was not a descendant and fixes it by wrapping a virtual div
around the message content so that find works as intended in any
case whatsoever. This solution even protects from future cases of
html content or hierarchy changes.

Fixes #16118.
timabbott pushed a commit that referenced this issue Aug 14, 2020
This commit solves a bug due non working find() for a html element
which was not a descendant and fixes it by wrapping a virtual div
around the message content so that find works as intended in any
case whatsoever. This solution even protects from future cases of
html content or hierarchy changes.

Fixes #16118.
timabbott pushed a commit that referenced this issue Aug 14, 2020
This fixes a bug with the original frontend-side implementation for
has: filters, where it would incorrectly not match content in cases
where the message's nesting structure did not have an outer tag.

Bug was introduced in 02ea52f.

Fixes #16118.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants