Skip to content

Commit dc9be47

Browse files
committed
encapsulate kludge property to fix invalid credential type error (#15225)
1 parent 747c2fd commit dc9be47

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

libs/common/src/tools/state/user-state-subject.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,14 @@ export class UserStateSubject<
161161
this.outputSubscription = userState$
162162
.pipe(
163163
switchMap((userState) => userState.state$),
164+
map((stored) => {
165+
if (stored && typeof stored === "object" && ALWAYS_UPDATE_KLUDGE in stored) {
166+
// related: ALWAYS_UPDATE_KLUDGE FIXME
167+
delete stored[ALWAYS_UPDATE_KLUDGE];
168+
}
169+
170+
return stored;
171+
}),
164172
this.declassify(encryptor$),
165173
this.adjust(combineLatestWith(constraints$)),
166174
takeUntil(anyComplete(account$)),

libs/tools/generator/core/src/providers/generator-profile-provider.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ describe("GeneratorProfileProvider", () => {
172172
await awaitAsync();
173173
const result = await firstValueFrom(stateProvider.getUserState$(SettingsKey, SomeUser));
174174

175-
expect(result).toEqual({ foo: "next value" });
175+
expect(result).toMatchObject({ foo: "next value" });
176176
});
177177

178178
it("waits for the user to become available", async () => {

0 commit comments

Comments
 (0)