Openrefine: Filter by regex - grey window spinning wheel on version 2.7

Created on 23 Jun 2017  路  10Comments  路  Source: OpenRefine/OpenRefine

Hi,
I'm using the 2.7 version, with linux (Ubuntu 17.04), Firefox.
My dataset contains +/- 1200 rows and 20 columns.

If I ask a column to be filtered by a regex, and once refine starts to interpret the regex, The page turns grey and I cannot interact with my dataset without having to reload the page.

Can you repeat this bug on your machines? Or is it just me?

bug High

Most helpful comment

I also have this bug, assuming the same cause. Any incomplete/invalid regular expression causes the front end to hang (i.e., grey with "waiting"). The form of the data is irrelevant to trigger this. I think this has been a bug at least since the last RC.

For instance, while "regular expression" is ticked, typing an open parenthesis "(", square bracket "[" (i.e., without content a closing parenthesis/bracket) will trigger this error. Similarly, typing an invalid regex and then clicking "regular expression" will also trigger the bug.

Given that regular expressions are frequently invalid while composing them, a simple fix might be to not send the regex with every keystroke, but rather after clicking "submit" or similar. Slightly better might be to use javascript to validate the regex before sending to the backend (Note that there are minor difference between the form of regexs in Javascript and Java).

All 10 comments

@hpiedcoq Can you give us 1 row of your data and the regex your trying on which column ?

I also have this bug, assuming the same cause. Any incomplete/invalid regular expression causes the front end to hang (i.e., grey with "waiting"). The form of the data is irrelevant to trigger this. I think this has been a bug at least since the last RC.

For instance, while "regular expression" is ticked, typing an open parenthesis "(", square bracket "[" (i.e., without content a closing parenthesis/bracket) will trigger this error. Similarly, typing an invalid regex and then clicking "regular expression" will also trigger the bug.

Given that regular expressions are frequently invalid while composing them, a simple fix might be to not send the regex with every keystroke, but rather after clicking "submit" or similar. Slightly better might be to use javascript to validate the regex before sending to the backend (Note that there are minor difference between the form of regexs in Javascript and Java).

@thadguidry Sorry Thad for my late answer to your message.
@tom-h answered for me by repeating the bug.
That's exactly it.

Looks like this issue was caused by this change: https://github.com/OpenRefine/OpenRefine/commit/aa65bc5c18ea7cd7582572b6d2fb1a7522016e4c
(returns an error code in the JSON rather than just logging to console)

I guess we need to handle an error being returned in the JSON here? But also might want to be a bit less aggressive updating the view when the user is entering a regular expression?

Not quite sure on the best approach at the moment. @thadguidry @wetneb Any ideas?

Of course we could revert https://github.com/OpenRefine/OpenRefine/commit/aa65bc5c18ea7cd7582572b6d2fb1a7522016e4c until we've sorted out the error handling at the client end

Just some notes for reference as I've investigated:

  • As filter updates, calls Refine.update({ engineChanged: true })
  • In turn calls Refine.createUpdateFunction(options, function()
  • In turn calls ui.dataTableView.update(onDone);
  • In turn calls Refine.fetchRows(start, this._pageSize, function()
  • Refine.fetchRows in project.js is the code that gets the error response from what I can see
  • No error handling here
  • Also Refine.fetchRows asks for JSONP response - I'm not clear why this is done as a JSONP call instead of plain JSON (uses JSONP here means you get a Fail on the xhr request. If you used JSON, you'd get a valid response that could be parsed for an error message)

@ostephens I agree with your analysis: if a JSON payload is already returned in case of error, I think the best solution would be to add client-side error handling. I'm not sure why JSONP vs JSON is relevant for that though.

@wetneb the JSONP vs JSON thing causes an additional error at the client end - I think because it requests JSONP it is expecting a javascript function in response - but it seems the JsonException function in the java returns just plain JSON.

@thadguidry @jackyq2015 do either of you know why JSONP is used for Refine.fetchRows? I can't see any obvious reason to use JSONP as it would never be cross-site as far as I can see. But I'm worried I'm missing something.

For current OR deployment, json and jsonp make no difference. I know OR have a unfinished broker model to separate the front end and engine itself. that could be the reason that jsonp was used for wider support.

Was this page helpful?
0 / 5 - 0 ratings