[Data Connect] MISSING_JOIN_TABLE_KEY false positive on tables with an explicit id key referenced by other tables
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 55/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- backend-api-design, cli
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
[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.
- Lingua principale
- TypeScript
- Stelle
- 4.5k
- Fork
- 1.3k
- Merge medio
- 2g 5h
- PR unite (30g)
- 68
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di firebase/firebase-tools
-
emulator: dataconnect
Difficoltà 1/5 1-3 ore Idoneità per principianti 90/100
firebase/firebase-tools#11402 ·
I maintainer di solito rispondono entro 1 giorno
-
Nodejs26 rejected at deploy, though Cloud Run functions supports it (Preview)Forse già presa @IzaakGough l’ha presa 3 giorni fa. Apertaapi: functions reproducible type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
firebase/firebase-tools#11393 · 2 commenti · 3 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
[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)Forse già presa @abhiramshaji-cyber l’ha presa 5 giorni fa. Apertareproducible type: bug VSCode Extension
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
firebase/firebase-tools#11363 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
[MCP] Crashlytics tools not loaded for Android projects using Gradle version catalogs (libs.versions.toml)Forse già presa @aalej l’ha presa 5 giorni fa. Apertaapi: mcp reproducible type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
firebase/firebase-tools#11351 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
CLI HTTP client ignores NO_PROXY, so emulators can’t reach each other behind a proxyForse già presa @joehan l’ha presa 20 giorni fa. Apertaemulator-suite type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
firebase/firebase-tools#11249 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di firebase/firebase-tools
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
ready-for-agent
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
LucasSantana-Dev/Lucky#2951 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
danielmiessler/LifeOS#2567 ·
I maintainer di solito rispondono entro 9 giorni
-
refactor(react-pi): classify base64 images with core's parseBase64Forse già presa @jimmyallinai l’ha presa oggi. Apertamaintenance
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
assistant-ui/assistant-ui#10293 · 2 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
brijeshb42/monaco-vim#175 ·