fix(dashboard): show every Supabase plan limit on the provider card

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

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
72/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
supabase, typescript

调研方向

Start with allowanceGroups and buildAllowances in src/lib/dashboard/aggregate.ts, then read the Supabase metric keys in docs/providers/supabase.md. Add a unit test with two supabase.plan.* included allowances for one account in both row orders, and check Resend’s limit and used pairing. Done when every Supabase plan limit appears in stable order and Resend still shows one allowance with its used amount.

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

描述

area: dashboard area: integrations bug

Problem

A Supabase provider card shows one plan limit per project, picked at random, and drops the rest.

The Supabase adapter stores up to seven included allowance metrics per project, all under the same supabase.plan. prefix (docs/providers/supabase.md, "Keys StackDash reads": supabase.plan.audit_log_retention, supabase.plan.log_retention, supabase.plan.edge_functions, supabase.plan.realtime_concurrent_users, supabase.plan.storage_max_file_size, plus the estimated supabase.plan.disk_size or supabase.plan.database_size and supabase.plan.monthly_active_users).

allowanceGroups (src/lib/dashboard/aggregate.ts, around line 435) groups included_allowance, remaining_allowance, and usage rows of one external account by the metric key without its last segment. Every supabase.plan.* key has the prefix supabase.plan, so all of a project's plan limits land in one group, and group.included ??= row keeps only the first. buildAllowances then emits one allowance per project from that row. Row order comes from loadSnapshots (src/lib/data/dashboard.ts, order("snapshot_date", desc).order("id", asc)), and id is a random UUID, so which limit a project shows depends on the ids its rows were given.

Seen while capturing evidence for a pull request: two workspaces with the same simulated Supabase data (same seed, same stored values for every supabase.plan.* row, checked in the database) showed different cards. One showed "Edge Functions" for Example app and "Monthly active users (estimated)" for Example app staging; the other showed "Realtime concurrent users" for both. Every other plan limit was missing from both cards.

The same grouping feeds allowancesToWatch and the quota projections, so they read the same one random limit per project.

Expected

Each stored Supabase plan limit is its own allowance on the card, in a stable order, as buildAllowances sorts them (account name, then label).

Fix (suggested)

Either give each Supabase plan limit a key whose prefix is unique to it (for example supabase.plan.edge_functions.limit), which needs a migration of stored keys and the docs table, or make the pairing rule treat an included_allowance with no matching used or remaining row as its own allowance keyed by its full metric key. The second keeps stored keys as they are; check that Resend's <prefix>.limit with <prefix>.used pairing still holds.

Acceptance criteria

  • A Supabase project with N stored supabase.plan.* included allowances shows N allowances on its provider card, whatever the row ids.
  • A unit test over allowanceGroups or buildAllowances with two supabase.plan.* rows for one account, in both row orders, gets both allowances.
  • Resend's paired allowance (limit with used) still shows as one allowance with its used amount.

Model: anthropic/claude-opus-5-5 | Reasoning effort: not reported by the harness

主要语言
TypeScript
星标
13
派生
2
平均合并
5 小时 20 分钟
30 天内合并 PR
287

环境准备

从这里开始

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

eddiejaoude/StackDash 的其他 Issue

查看 eddiejaoude/StackDash 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

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