Bad query error when searching in GNOME Software (special chars snap)

Bug #1717573 reported by AsciiWolf on 2017-09-15
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
snapd
High
Unassigned
gnome-software (Ubuntu)
Medium
Unassigned

Bug Description

If a user types "=" into the search bar in GNOME Software when searching for an application, he gets a "bad query" error instead of the actual search results.

Steps to reproduce:
1. Open GNOME Software.
2. Type "someapp=".

Robert Ancell (robert-ancell) wrote :

The bug appears to be in snapd which is returning this error.

Changed in gnome-software (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
Robert Ancell (robert-ancell) wrote :

From store/store.go in the snapd repository:

// these characters might have special meaning on the search
// server, and don't form part of a reasonable search, so
// abort if they're included.
//
// "-" might also be special on the server, but it's also a
// valid part of a package name, so we let it pass
if strings.ContainsAny(searchTerm, `+=&|><!(){}[]^"~*?:\/`) {
        return nil, ErrBadQuery
}

Robert Ancell (robert-ancell) wrote :

Testing shows +&><() seem to work fine, but =|!{}[]^"~*?:\/ do not.

Robert Ancell (robert-ancell) wrote :

I opened a forum topic to discuss with the snapd authors:
https://forum.snapcraft.io/t/special-characters-cause-searches-to-fail/2158

summary: - Bad query error when searching in GNOME Software
+ Bad query error when searching in GNOME Software (special chars)
summary: - Bad query error when searching in GNOME Software (special chars)
+ Bad query error when searching in GNOME Software (special chars snap)
tags: added: gnome-software-snap
AsciiWolf (asciiwolf) wrote :

Still happening in Bionic.

tags: added: bionic
Michael Vogt (mvo) wrote :

It seems what you need is the right error kind to distinguish this error, this is done in: https://github.com/snapcore/snapd/pull/4428 now

Changed in snapd:
status: New → In Progress
Changed in snapd:
importance: Undecided → High
status: In Progress → Fix Committed
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers