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

FIX: Rule engine fixes #2183

Merged
merged 1 commit into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 1 addition & 5 deletions backend/Origam.Rule/DatasetRuleHandler.cs
Expand Up @@ -265,11 +265,7 @@ public void OnRowCopied(DataRow row, IDataDocument data, DataStructureRuleSet ru

private void table_RowChanged(object sender, DataRowChangeEventArgs e)
{
// The RowChanged event fires after every call to DataRow.EndEdit().
// Every field change calls the DataRow.EndEdit(). This led to
// execution of the OnRowChanged handler after changing just a single
// field which added undesired overhead.
if (e.Action != DataRowAction.Change && e.Action != DataRowAction.Nothing)
if (e.Action != DataRowAction.Nothing && e.Action != DataRowAction.Commit)
{
OnRowChanged(e, _currentRuleDocument, _ruleSet, _ruleEngine);
}
Expand Down
13 changes: 12 additions & 1 deletion backend/Origam.Server/Session Stores/SessionStore.cs
Expand Up @@ -1380,7 +1380,18 @@ public ArrayList RowStates(string entity, object[] ids)
}

// data not requested (data less session)
return RowStatesForDataLessSessions(entity, ids, profileId);
try
{
lock (_lock) // no update should be done in the meantime when rules are not handled
{
this.UnregisterEvents();
return RowStatesForDataLessSessions(entity, ids, profileId);
}
}
finally
{
this.RegisterEvents();
}
}

private ArrayList RowStatesForDataLessSessions(string entity, object[] ids, object profileId)
Expand Down