Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[Auth Guard - BUG] canActivate auth guard causes blank screen after cache clear with multiple tabs opens.

オープン
#3,691 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
38/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
angular, firebase, typescript

調査の方向性

issue に記載されている最小限の AngularFire 認証セットアップから始め、redirectLoggedInTo と redirectUnauthorizedTo を指定した canActivate ガードを使用します。2 つのタブで動作を再現し、一方のタブでキャッシュをクリアして、そのタブをリフレッシュします。もう一方のタブを開いたまま、リフレッシュしたタブが空白画面を表示せず正常に読み込まれれば完了です。

索引モデルが issue の本文から書いたものです。

説明

If using the canActivate auth guard (with spread syntax), If you have more than 1 tab open of the same app, and then you clear the cache by using the browser in one of the tabs, and try to refresh, it causes a blank screen, which resolves after you close the other open tab.

steps to reproduce:

versions:
"@angular/common": "^20.3.0",
"@angular/compiler": "^20.3.0",
"@angular/core": "^20.3.0",
"@angular/fire": "^20.0.1",
"@angular/forms": "^20.3.0",
"@angular/platform-browser": "^20.3.0",
"@angular/router": "^20.3.0",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.15.0"

steps to reproduce:

  1. Create new project
  2. install angular fire
  3. setup authentication and firebase project
  4. utilize the ...canActivate auth guard like below.
  5. open two tabs of the same page.
  6. in one of them, clear the cache (by using the button close to the url in chrome for ex)
  7. refresh
  8. blank screen.
  9. verify that if you close the second tab, then the first one loads correctly.
const redirectTeste1 = () => redirectLoggedInTo('test2');
const redirectTeste2 = () => redirectUnauthorizedTo('teste1');

export const routes: Routes = [
  { path: '', redirectTo: 'teste1', pathMatch: 'full' },

  {
    path: 'teste1',
    component: Test1,
    ...canActivate(redirectTeste1),
  },

  {
    path: 'teste2',
    component: Test2,
    ...canActivate(redirectTeste2),
  },
];

lmk if this is somehow a user error, but with such a barebones configuration I think is a legitimate bug.

主要言語
TypeScript
スター
7.8k
フォーク
2.2k
平均マージ
3日 6時間
マージ済み PR(30日)
5

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

angular/angularfire のほかの issue

angular/angularfire の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。