Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Error recovery: no retry path once an observable cache entry errors

未关闭
#742 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
功能
描述清晰度
需要澄清
活跃度
冷清
技术栈
firebase, react, typescript
领域
frontend

调研方向

从 preloadObservable 和全局 preloadedObservables 缓存开始,然后通过 hook 的非 Suspense 状态路径跟踪 SuspenseSubject 的错误和重置行为。完成标准是:约定的重试或重置路径能够让出错条目使用相同的 observableId 恢复,而不需要不同的 ID 或 remount 变通方案。

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

描述

v5

Problem

Once a reactfire hook enters status: 'error', there is no way to recover without remounting with a different observableId.

The errored SuspenseSubject stays in the global preloadedObservables cache under its observableId. On error, the 30-second reset timer is cancelled (it becomes a no-op timeout), and the observable does not re-subscribe. A component that remounts with the same observableId rejoins the same errored subject and immediately receives status: 'error' again.

This became user-visible in v4.3.0, which made status: 'error' reachable in non-suspense mode (previously errors always threw, so the stuck state was hidden). Users building status === 'error' UI now have no way to trigger a retry.

Current workaround

Change the observableId passed to the hook. This causes preloadObservable to create a fresh SuspenseSubject and re-subscribe to the source. Not a real API — just an escape hatch.

What a fix might look like

  • An explicit retry() / reset() function returned from the hook, or
  • A retryOnError option that re-subscribes automatically after a delay, or
  • Cache eviction on error after the reset timeout (restoring the pre-v4.3 behavior for the cache entry, not for error surfacing)

The right shape is an open question. Filing to track the gap.

Closes none. Related to #735.

主要语言
TypeScript
星标
3.6k
派生
403
平均合并
5 天 1 小时
30 天内合并 PR
10

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

FirebaseExtended/reactfire 的其他 Issue

查看 FirebaseExtended/reactfire 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

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