1
0

90252: Invalidate requests containing DSO on DataService.delete

Keep track of a list of request UUIDs in the object cache (most recent in front)
When deleting a DSO, mark all of these as stale
This commit is contained in:
Yura Bondarenko
2022-04-07 17:15:07 +02:00
parent 19fa36f243
commit c19d12c5c0
9 changed files with 266 additions and 18 deletions

View File

@@ -197,7 +197,7 @@ export class ObjectCacheService {
*/
getRequestUUIDBySelfLink(selfLink: string): Observable<string> {
return this.getByHref(selfLink).pipe(
map((entry: ObjectCacheEntry) => entry.requestUUID),
map((entry: ObjectCacheEntry) => entry.requestUUIDs[0]),
distinctUntilChanged());
}
@@ -282,7 +282,7 @@ export class ObjectCacheService {
let result = false;
this.getByHref(href).subscribe((entry: ObjectCacheEntry) => {
if (isNotEmpty(requestUUID)) {
result = entry.requestUUID === requestUUID;
result = entry.requestUUIDs[0] === requestUUID; // todo: may make more sense to do entry.requestUUIDs.includes(requestUUID) instead
} else {
result = true;
}