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

#10766: Remove error notified by GeoFence when moving a rule for geofence stand-alone version only #10767

Merged
merged 1 commit into from
Jan 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions web/client/observables/rulesmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ const fullUpdate = (update$) => update$.filter(({rule: r, origRule: oR}) =>getUp
.catch((e) => {
const {priority: p, id: omit, ...oldRule} = origRule;
oldRule.position = {value: p, position: "fixedPriority"};
// We have to restore original rule and to throw the exception!!
return Rx.Observable.defer(() => GeoFence.addRule(oldRule)).concat(Rx.Observable.of({type: RULE_SAVED}).do(() => { throw (e); }));
// We have to restore original rule and throw the exception if failed!!
return Rx.Observable.defer(() => GeoFence.addRule(oldRule)).catch(() => { throw (e); });
});
})
.switchMap(({data: id}) => {
return Rx.Observable.defer(() => GeoFence.moveRules(rule.priority, [{id}]));
return Rx.Observable.defer(() => GeoFence.moveRules(rule.priority, [{id}])).concat(Rx.Observable.of({type: RULE_SAVED}));
}
));
const grantUpdate = (update$) => update$.filter(({rule: r, origRule: oR}) => getUpdateType(oR, r) === 'grant')
Expand Down
Loading