Bug #2682

Updated by Sebastien Jacquot about 1 year ago


There are most cases where an editor may seems ready to be used but actually doesn't.
Behavior is problematic according to the duration of the parents branch computing *or* duration of the result computing itself.

* a) reopening a persisted result when its parent branch is not ready
* b) computing a complex result

In both of these cases, if the duration is too long, the editor widget should be disabled or not opened before the computing has ended.
Otherwise, user can change paramaters and run a compute leading to wrong result or simply some crashes due of various reasons.

h3. Example of bug 1

There is a bug in 0.8.0 where the index of partition found nothing if the parent partition parts are not computed yet, typically when reopening TXM.
More information: the problem here is important. When creating an index of partition, the editor opens and the parent and children of parent are computed in background. But since the editor is ready, if we type eg. "faire" before the parts are computed, nothing is found in the index.

h2. Steps to reproduce

=> have a Partition based on a complex query, eg. ELTECFRAORIG_sp_n
=> launch TXM execute Index with "faire" query
=> the editor and console return no results

h3. Solutions to restrict and/or avoid the behavior of case a)

* ensure the computing of parents branch is done before displaying the editor

SJ: solution has been implemented by running a modal cancelable dialog to block the UI until the needed parents branch is computed.
The editor is not displayed until the process has ended.
*NOTE: later,
NOTE: it would be nice to manage a blocking state only for the concerned branch, so the user can still use TXM on other corpora or branches* branches

h3. Solutions to restrict and/or avoid the behavior of case b)

* 1) permit only one compute at a time in TXMEditor.Compute() by storing the current computing Job and returns if it's already running
=> will avoid the possibility to get some wrong results when the Partition is not yet computed (eg. typing "faire" in an Index does not return empty result anymore, atm this message is displayed in the console: "Editor is already computing .... Please wait or abort the computing job (Calcul de Index de partition: ELTECFRAORIG_sp_n: ...…).")
=> It doesn't avoid to open another Index
SJ: this solution 1 has been implemented. *Need to translate the log.*

* 2) on computing, find a way to disable the editor widgets (or computing button) so the user can not start successive computings