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

String input "all", followed by quickly changing query breaks search bar #842

Open
geneukum opened this issue Dec 1, 2022 · 4 comments
Open

Comments

@geneukum
Copy link
Contributor

geneukum commented Dec 1, 2022

When I enter the string "all" into the search bar on https://api.emberjs.com/ember/release, I see a console error logged:

Unhandled Promise Rejection: TypeError: undefined is not an object (evaluating 'this.get("result.module").includes')

After this error occurs, the search feature becomes unresponsive (so backing out "all" and then entering a new query string shows the old results).

@geneukum
Copy link
Contributor Author

geneukum commented Dec 1, 2022

To add to the original post, this doesn't seem to reproduce unless I fairly quickly type something else into the search bar which appears to result in a different console error:

Unhandled Promise Rejection: TypeError: undefined is not an object (evaluating 'this.boundList[0].firstNode')

@geneukum geneukum changed the title String input "all" breaks search bar String input "all", followed by quickly changing query breaks search bar Dec 1, 2022
@jenweber
Copy link
Contributor

jenweber commented Dec 2, 2022

What are you trying to search for when you type “all”? This may help with narrowing down the issue, if there’s some specific method in the docs that is the problem.

@geneukum
Copy link
Contributor Author

geneukum commented Dec 6, 2022

Hey @jenweber, I think that I might have been looking for alias or something like that, but it has been a few days so I don't totally remember.

I stepped through the error a bit and I think that first one is happening because the entry associated with "node_modules/rsvp/lib/rsvp/promise/all.js" does not have a top level module property:

...
  {
      "file": "node_modules/rsvp/lib/rsvp/promise/all.js",
      "line": 3,
      "class": "Promise",
      "name": "all",
      "static": 1,
      "_tags": ["module:undefined", "version:4.8.0"],
      "hierarchy": { "lvl1": "Promise", "lvl2": "all" },
      "objectID": "969593002",
      "_highlightResult": {
        "name": {
          "value": "<em>all</em>",
          "matchLevel": "full",
          "fullyHighlighted": true,
          "matchedWords": ["all"]
        },
        "hierarchy": {
          "lvl1": {
            "value": "Promise",
            "matchLevel": "none",
            "matchedWords": []
          },
          "lvl2": {
            "value": "<em>all</em>",
            "matchLevel": "full",
            "fullyHighlighted": true,
            "matchedWords": ["all"]
          }
        }
      }
 ...

This causes an error on line 16 in app/components/search-input/dropdown-result.js where it tries to unpack that value as: let module = this.get('result.module');.

@geneukum
Copy link
Contributor Author

geneukum commented Dec 18, 2022

It looks like we get the same behavior any time that we search for all, race, reject, or resolve and that the entries breaking it are the ones scoped to the Promise class from the RSVP project.

We probably need to update the docs in some way so that these entries end up getting scoped to the right module rather than being undefined.

Alternatively/Additionally, maybe we could update this DropdownResult component to drop those results which don't have the expected structure?

Do you have any thoughts, @jenweber?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants