8000 fix(quota): keep a waiting weekly window after it resets for 0.12.3 by InfinityPacer · Pull Request #51 · InfinityPacer/meterleaf · GitHub
[go: up one dir, main page]

Skip to content

fix(quota): keep a waiting weekly window after it resets for 0.12.3 - #51

Merged
InfinityPacer merged 1 commit into
mainfrom
fix/quota-week-placeholder
Oct 23, 2026
Merged

InfinityPacer merged 1 commit into
mainfrom
fix/quota-week-placeholder

Conversation

@InfinityPacer
Copy link
Copy Markdown
Owner

问题

周额度到了重置时刻、新快照还没到时,账户卡片整行不显示 7d,「7d 预估」变成 N/A,看起来像故障。新快照要等这个账户再发出请求才会到。Pro 账户 5h 已用满时,要等到 5h 重置才能刷新,期间周额度会消失几个小时。5h 过期时已经有「等待更新」占位,周额度没有。

结果

  • visibleQuotaWindows(src/web/lib/quota-display.ts)在 5h 有效、周额度已过期时,追加一个不带旧百分比的 7d 等待占位,显示「等待更新」和重置时刻。
  • 上一周期结束超过一周仍无新快照,或 5h 也无效时,不再占位,与 Fable 占位的规则一致。
  • 占位不参与「已用满」判断。周额度在等待时不再叠加 Fable 占位。
  • 数据库结构未变,只需升级服务端镜像。

验证

  • bun run typecheck 通过,bun test tests 549 个测试全部通过,bun run build 成功。
  • 新增测试覆盖本次场景(周额度 4 小时前重置、5h 用满),以及超过一周、从未上报、5h 也无效三种不占位的情况。原有用例「weekly reset restores five-hour visibility」的断言改为新行为,仍检查重置后账户不被判定为已用满。
  • 等待占位与 5h 等待占位共用 QuotaWindow 的同一渲染分支,演示数据里 5h 等待占位的桌面与手机布局已检查过。

🤖 Generated with Claude Code

When the weekly window passed its reset and no new sample had arrived, the
row dropped it entirely and the 7d estimate went N/A, which read as a fault.
With an active five-hour window the weekly window now keeps a waiting
placeholder, mirroring the five-hour rule, until a new sample or a week
after the old period ended.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@InfinityPacer
InfinityPacer merged commit 699afb4 into main Oct 23, 2026
2 checks passed
@InfinityPacer
InfinityPacer deleted the fix/quota-week-placeholder branch October 23, 2026 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0