fix(core): fix groupBy and orderBy error handling (#12584)

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

- **Bug Fixes**
  - Improved error handling for ordering and grouping features to prevent disruptions and ensure the app continues running smoothly if errors occur.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
EYHN
2025-05-28 06:58:26 +00:00
parent ace4b844fd
commit a045786c6a

View File

@@ -162,7 +162,13 @@ export class CollectionRulesService extends Service {
})
);
return combineLatest([
orderByProvider.orderBy$(items$, orderBy),
orderByProvider.orderBy$(items$, orderBy).pipe(
catchError(error => {
// Return an empty array when orderBy fails, typically when the orderBy property has been deleted
console.error(error);
return of([]);
})
),
shared$,
]).pipe(
map(([ordered, last]) => {
@@ -201,7 +207,13 @@ export class CollectionRulesService extends Service {
})
);
return combineLatest([
groupByProvider.groupBy$(items$, groupBy),
groupByProvider.groupBy$(items$, groupBy).pipe(
catchError(error => {
// Return an empty array when groupBy fails, typically when the groupBy property has been deleted
console.error(error);
return of(new Map<string, Set<string>>());
})
),
shared$,
]).pipe(
map(([grouped, last]) => {