insomnia icon indicating copy to clipboard operation
insomnia copied to clipboard

Rendering error when loading entry from JsonPath filter history

Open XReaper95 opened this issue 1 year ago • 5 comments

Expected Behavior

Not getting a rendering error.

Actual Behavior

The response view breaks, the whole pane goes blank, showing a single error:

Render Failure: Failed to execute 'querySelector' on 'Element': '[data-key="$.data[?(@.some_prop =~ "value")]"]' is not a valid selector.

Stack trace (from DevTools):

18:27:51.772 › DOMException: Failed to execute 'querySelector' on 'Element': '[data-key="$.data[?(@.some_prop =~ "value")]"]' is not a valid selector.
    at file:///opt/Insomnia/resources/app.asar/index-7770d3c9.js:118:78623
    at gh (file:///opt/Insomnia/resources/app.asar/index-7770d3c9.js:118:24296)
    at s6 (file:///opt/Insomnia/resources/app.asar/index-7770d3c9.js:118:42448)
    at Wbe (file:///opt/Insomnia/resources/app.asar/index-7770d3c9.js:118:41270)
    at Ic (file:///opt/Insomnia/resources/app.asar/index-7770d3c9.js:118:40309)
    at H_ (file:///opt/Insomnia/resources/app.asar/index-7770d3c9.js:118:36912)
    at pc (file:///opt/Insomnia/resources/app.asar/index-7770d3c9.js:116:3288)
    at file:///opt/Insomnia/resources/app.asar/index-7770d3c9.js:118:34286
    at node:internal/process/task_queues:140:7
    at AsyncResource.runInAsyncScope (node:async_hooks:204:9)
    at AsyncResource.runMicrotask (node:internal/process/task_queues:137:8)

Reproduction Steps

  1. Search for the query shown in the error ($.data[?(@.some_prop =~ "value")]) in JSONPath filter bar, at the bottom of the response view.
  2. Open the filter history drop-down (the clock icon)
  3. Select the entry, the rendering error occurs as soon as the mouse hovers over the entry.

Is worth noting that it works OK when running the query in the filter bar. The error is exclusive when selecting the history entry.

Is there an existing issue for this?

Additional Information

Actually, selecting some entries trigger the error, not only the one above, some other entries with errors:

  • $.data[?(@.some_prop.includes("value"))]
  • $.data[[?(@.some_prop === "value")]]"]

I understand these aren't valid filters, yet I guess no rendering error should happen.

Insomnia Version

2023.5.7

What operating system are you using?

Other Linux

Operating System Version

Linux 6.1.49-1-MANJARO #1 SMP PREEMPT_DYNAMIC Sun Aug 27 23:08:04 UTC 2023 x86_64 GNU/Linu

Installation method

yay -S insomnia-bin (AUR)

Last Known Working Insomnia version

???

XReaper95 avatar Sep 06 '23 21:09 XReaper95

Another error sample: Render Failure: Failed to execute 'querySelector' on 'Element': '[data-key="$..["point", "berthDate"]"]' is not a valid selector.

As a workaround, where can I find the local config files to purge the query history?

ilengyel avatar Sep 14 '23 02:09 ilengyel

As a workaround, where can I find the local config files to purge the query history?

I had success by searching for and removing the offending queries in %APPDATA%\insomnia\insomnia.RequestMeta.db

ilengyel avatar Sep 14 '23 04:09 ilengyel

Just wanted to confirm I came across the same issue with Insomnia 2023.5.8 running on Windows 11. Deleting the history worked for me. But that kind of kills the purpose of having a history. 😁🤷‍♂️

rmsilva1973 avatar Dec 16 '23 18:12 rmsilva1973

Also, this seems to be a duplicate of #5846

rmsilva1973 avatar Dec 16 '23 18:12 rmsilva1973

was very annoying for me too, but tried to reproduce right now and could not - maybe fixed? 8.6.1

alexander-veshkin avatar Feb 06 '24 13:02 alexander-veshkin