[Data Connect] MISSING_JOIN_TABLE_KEY false positive on tables with an explicit id key referenced by other tables
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 55/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
调研方向
Start by tracing the Data Connect schema compilation path used by firebase dataconnect:compile and find where MISSING_JOIN_TABLE_KEY is detected; the issue does not name implementation files or tests. Check how the detection handles explicit @table(key: ["id"]) declarations and references from other tables, then add coverage for the Enrollment schema. Done when that schema no longer produces the warning while genuine join tables still do.
由索引模型根据 Issue 内容生成。
描述
[REQUIRED] Environment info
firebase-tools: 15.34.1 (Data Connect emulator / toolkit 3.4.24)
Platform: macOS 26.4, Node 22
[REQUIRED] Test case
A table with two required @ref fields that is an entity in its own right, not a join table. It has its own id key, the pair of parents is intentionally not unique, and another table references it by id:
type User @table { name: String! }
type Plan @table { title: String! }
# A user can enroll in the same plan more than once (re-enrollment),
# so (user, plan) is not unique and cannot be the primary key.
type Enrollment @table(key: ["id"]) {
id: UUID! @default(expr: "uuidV4()")
user: User!
plan: Plan!
startDate: Date!
status: String!
}
# Other tables reference an enrollment by its id.
type Session @table {
enrollment: Enrollment
performedAt: Timestamp!
}
The same thing happens for other common shapes, e.g. a "notes about a user written by an author" table (many notes per author/user pair), or an ordered "exercises in a workout" table where the same exercise can appear twice.
[REQUIRED] Steps to reproduce
- Use the schema above.
- Run
firebase deploy --only dataconnect(also shown byfirebase dataconnect:compile).
[REQUIRED] Expected behavior
No MISSING_JOIN_TABLE_KEY warning for Enrollment. It explicitly declares key: ["id"], and another table references that key, so it can't be a join table missing its composite key. Alternatively, a way to acknowledge the warning per table (e.g. a schema-level opt-out) so it doesn't show on every deploy.
[REQUIRED] Actual behavior
Every deploy lists the table as an insecure operation or risky change and asks for acknowledgement:
MISSING_JOIN_TABLE_KEY schema/....gql: On Enrollment: This table looks like a join table, but it is missing the composite primary key definition.
Workaround: Add `@table(key: ["plan", "user"])` to the type.
Reason: A join table must have a composite primary key that consists of two foreign keys.
Following the suggested workaround would be wrong here. It would break re-enrollment, drop the id that Session references, and require a primary-key migration on a populated table.
Related: #9630 (@view false positive, fixed in v15.3.0) and #9762 (3-column composite key false positive). In both, a maintainer confirmed the warning is non-blocking and shouldn't trigger in those cases.
- 主要语言
- TypeScript
- 星标
- 4.5k
- 派生
- 1.3k
- 平均合并
- 2 天 18 小时
- 30 天内合并 PR
- 93
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
firebase/firebase-tools 的其他 Issue
-
Nodejs26 rejected at deploy, though Cloud Run functions supports it (Preview)可能已有人在做 @IzaakGough 于 6 天前认领。 未关闭api: functions reproducible type: bug
难度 2/5 1-3 小时 新手友好度 76/100
firebase/firebase-tools#11393 · 2 条评论 · 4 个 reaction ·
维护者通常 1 天内回复
-
[firebase-vscode] CLI version check reads the version from the debug banner, because logSetup() leaks DEBUG=true into the spawned `firebase --version` (follow-up to #10874)可能已有人在做 @abhiramshaji-cyber 于 7 天前认领。 未关闭reproducible type: bug VSCode Extension
难度 2/5 1-3 小时 新手友好度 78/100
firebase/firebase-tools#11363 · 2 条评论 ·
维护者通常 1 天内回复
-
[MCP] Crashlytics tools not loaded for Android projects using Gradle version catalogs (libs.versions.toml)可能已有人在做 @aalej 于 8 天前认领。 未关闭api: mcp reproducible type: bug
难度 2/5 1-3 小时 新手友好度 82/100
firebase/firebase-tools#11351 · 1 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
CLI HTTP client ignores NO_PROXY, so emulators can’t reach each other behind a proxy可能已有人在做 @joehan 于 23 天前认领。 未关闭emulator-suite type: bug
难度 2/5 1-3 小时 新手友好度 74/100
firebase/firebase-tools#11249 · 已指派 1 人 ·
维护者通常 1 天内回复
-
functions:secrets:set and :prune never destroy anything: pruneSecrets filters firebase-managed=true, but labels() writes firebase-managed=functions可能已有人在做 @IzaakGough 于 56 天前认领。 未关闭api: functions reproducible type: bug
难度 2/5 1-3 小时 新手友好度 90/100
firebase/firebase-tools#11066 · 2 条评论 ·
维护者通常 1 天内回复
查看 firebase/firebase-tools 的全部 Issue
相似的 Issue
-
test-reliability
难度 2/5 1-3 小时 新手友好度 78/100
Azure/azure-sdk-for-js#40672 · 1 个 reaction ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
HarperFast/studio#2067 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
documentation
难度 2/5 1-3 小时 新手友好度 76/100
liberation-data/drivine#639 · 2 条评论 ·
维护者通常 1 天内回复