Skip to content

Commit

Permalink
fix(core/securityGroup): Clone cached data before mutating it (#8447)
Browse files Browse the repository at this point in the history
Closes #8444
  • Loading branch information
christopherthielen committed Jul 30, 2020
1 parent a731253 commit 5a502e7
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { ISecurityGroupSearchResult } from './securityGroupSearchResultType';
import { ProviderServiceDelegate, PROVIDER_SERVICE_DELEGATE } from 'core/cloudProvider/providerService.delegate';
import { IMoniker } from 'core/naming/IMoniker';
import { IEntityTags } from 'core/domain/IEntityTags';
import { cloneDeep } from 'lodash';

export interface ISecurityGroupsByAccount {
[account: string]: {
Expand Down Expand Up @@ -297,7 +298,7 @@ export class SecurityGroupReader {
const cache = InfrastructureCaches.get('securityGroups');
const cached = cache ? cache.get('allGroups') : null;
if (cached) {
return this.$q.resolve(this.decompress(cached));
return this.$q.resolve(this.decompress(cloneDeep(cached)));
}
return API.one('securityGroups')
.get()
Expand Down

0 comments on commit 5a502e7

Please sign in to comment.