You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Various validators can throw InvalidTransactionException during the IValidationContext.Ended event. However, at this point the HistoryContext override of OnEnded will already have logged the transaction and set the dirty flag. The exception is then thrown and the HistoryContext is now in an invalid state. This leads to documents being flagged as Dirty when they are in fact clean.
Perhaps validators should not throw during OnEnded - but during OnEnding instead. The transaction has supposedly ended and so it should not be possible to cancel it at that point.
There is a related issue here though in that some validators modify the Dom during OnEnding. This will mean that the order in which validators subscribe to the validation events is critical. Any modifications made to the Dom by a validator during OnEnding will not be validated by validators earlier in the subscription list.
It is possibly a mistake to mix the two different concepts of data validation and data coercion. Perhaps this issue could be worked around by separating the two - all 'Coercers' operate first then in a second pass, all Validators check the data consistency.
The text was updated successfully, but these errors were encountered:
Various validators can throw InvalidTransactionException during the IValidationContext.Ended event. However, at this point the HistoryContext override of OnEnded will already have logged the transaction and set the dirty flag. The exception is then thrown and the HistoryContext is now in an invalid state. This leads to documents being flagged as Dirty when they are in fact clean.
Perhaps validators should not throw during OnEnded - but during OnEnding instead. The transaction has supposedly ended and so it should not be possible to cancel it at that point.
There is a related issue here though in that some validators modify the Dom during OnEnding. This will mean that the order in which validators subscribe to the validation events is critical. Any modifications made to the Dom by a validator during OnEnding will not be validated by validators earlier in the subscription list.
It is possibly a mistake to mix the two different concepts of data validation and data coercion. Perhaps this issue could be worked around by separating the two - all 'Coercers' operate first then in a second pass, all Validators check the data consistency.
The text was updated successfully, but these errors were encountered: