Optional expiry for persisted demand coverage
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
- Issue 类型
- 功能
- 描述清晰度
- 需要澄清
- 活跃度
- 活跃
- 技术栈
- sqlite, typescript
调研方向
Start with the persisted demand coverage proposal in issue #2102 and compare its behavior with the persistedGcTime control discussed in #1380 and #1400. The issue leaves the expiry start time, its relationship to row retention, and the implementation deferred until a user asks; first clarify those design decisions. Done would mean defining the optional expiry behavior and adding a settlement timestamp to the coverage record, as described here.
由索引模型根据 Issue 内容生成。
描述
Problem
The persisted demand coverage proposal (#2102, item 1) lets the persisted wrapper settle an on-demand load from SQLite when that exact demand finished loading in an earlier session. Coverage stays valid until its persisted cache generation ends, or until a later load of the same demand settles.
After a demand is released, its source stops sending changes for it. A deleted or moved row keeps appearing in that demand's offline result until the demand loads again online. For many offline-first apps, the last complete result is the right answer. Others may want a bound on how old a covered result can be before the app stops trusting it offline.
Query DB already has this control for its own retention: persistedGcTime keeps a released Query's persisted rows for a TTL or until revalidated (#1380, #1400).
Proposal
Add an optional expiry to persisted demand coverage. Its shape should follow persistedGcTime:
- a finite duration measured from when the covered load settled, or from when the demand was released (to be decided);
- an "until revalidated" value, which is the default and today's proposed behavior.
An expired demand counts as uncovered. It waits for the network and is reported the same way as any uncovered demand.
Not doing yet
Do not implement this until a user asks for it. The default (valid until revalidated or until the generation ends) needs no option. This issue records the design so the coverage record keeps room for a timestamp.
Design notes
- Store the settlement time with the coverage record now, so that expiry can be added later without a storage migration.
- Decide whether Query DB's
persistedGcTimeshould drive this expiry for Query Collections, or stay a separate row-retention control. - An oracle law would add a clock to the persisted-readiness model: a covered demand settles from SQLite only while its coverage is unexpired at the load's start.
Related: #2102, #1380, #1955.
- 主要语言
- TypeScript
- 星标
- 3.9k
- 派生
- 277
- 平均合并
- 18 小时 12 分钟
- 30 天内合并 PR
- 229
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
TanStack/db 的其他 Issue
-
难度 4/5 1-2 天 新手友好度 48/100
维护者通常 1 天内回复
-
Ordered-replay oracle: terminal error after a failed settle following truncate markers可能已有人在做 @KyleAMathews 今天认领。 未关闭
难度 4/5 3-5 天 新手友好度 35/100
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 35/100
维护者通常 1 天内回复
-
难度 4/5 1-2 天 新手友好度 58/100
维护者通常 1 天内回复
-
难度 4/5 1-2 天 新手友好度 48/100
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
Nimblesite/SharpLsp#468 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
Bundled uv is never updated and trusts the compromised eMudhra certificates可能已有人在做 @FabienDanieau 今天认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 76/100
-
bg_wait's blocking mode (stopOnAttention: false) is under-documented and effectively undiscoverable未关闭
难度 2/5 1-3 小时 新手友好度 66/100
nicobailon/pi-subagents#3019 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
db-ux-design-system/core-web#8613 ·
维护者通常 1 天内回复