angular / angular/angularfire

signout function in ngrx effect with()

未关闭
#3,251 6 条评论 4 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
TypeScript
星标
7.8k
派生
2.2k
平均合并
22 小时 28 分钟
30 天内合并 PR
6

描述

Hello,
I have an NGRX in my project, and when I sign user out I got the error explained below, please notice that I use NGRX with:
```
runtimeChecks: {
strictStateImmutability: true,
strictActionImmutability: true,
},
```

### Version info

**Angular:**
~13.3.0
**Firebase:**
^9.1.0
**AngularFire:**
^7.2.1

### How to reproduce these conditions
auth.effects.ts:
```
clearLocalstorageOnLogout$ = createEffect(
() =>
this.actions$.pipe(
ofType(AuthActions.logout),
tap(async () => {
// @todo: there is a bug here
await this.firebaseAuth.signOut();
}),
),
{dispatch: false}
);

constructor(
private readonly actions$: Actions,
private firebaseAuth: Auth,
private router: Router,
) {
}
```

### Debug output

** Errors in the JavaScript console **
```
Unhandled Promise rejection: Cannot assign to read only property 'operations' of object '[object Object]' ; Zone: ; Task: Promise.then ; Value: TypeError: Cannot assign to read only property 'operations' of object '[object Object]'

Unhandled Promise rejection: Cannot assign to read only property 'isRunning' of object '[object Object]' ; Zone: ; Task: Promise.then ; Value: TypeError: Cannot assign to read only property 'isRunning' of object '[object Object]'
```
** Screenshots **
Screen Shot 1444-01-05 at 9 35 49 PM
Screen Shot 1444-01-05 at 9 35 41 PM

贡献指南

打开贡献指南

调研方向

从 auth.effects.ts 开始,重点检查 clearLocalstorageOnLogout$、其 createEffect 管道以及对 firebaseAuth.signOut(); 的调用;使用列出的 Angular、Firebase 和 AngularFire 版本,并启用运行时检查来复现 logout 流程。完成的标准是 signout 流程能够完成,且不会出现报告中的 read-only-property 或 unhandled-promise 错误。

由索引模型根据 Issue 内容生成。

评估

技术栈
angular, firebase, typescript
领域
authentication, frontend
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。