Commit 02376a3
[Explicit table names] Fix using IDs with a supertype table (#44408)
The new `GenericDatabaseReader`/`GenericDatabaseWriter` signatures added in 1.30.0 have a bug in their types: they calls like `db.get("table1", id)`, with `id: Id<"table1"> | Id<"table2">`, incorrectly type check.
Thanks for termosa on Discord for reporting the bug (https://discord.com/channels/1019350475847499849/1448756823107702805/1448781976466227250)!
### Note about making a breaking change
Changing the TypeScript types can be a breaking change in rare cases. It affects users that have custom implementations of GenericDatabaseWriter/Reader in their codebase. However, this change is simple to apply, and it is only necessary for users that have custom GenericDatabaseWriter/Reader implementations _and_ have already updated to 1.31.0.
I will update convex-test and convex-helpers after 1.31.2 is released to update the types they use.
GitOrigin-RevId: 9b9c9b6ba96eec6e959cd3eba06ef4a3e3a122d71 parent 04c7058 commit 02376a3
3 files changed
+99
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
3 | 10 | | |
4 | 11 | | |
5 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | | - | |
| 24 | + | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
188 | | - | |
189 | | - | |
| 188 | + | |
| 189 | + | |
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
| |||
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
218 | | - | |
219 | | - | |
| 218 | + | |
| 219 | + | |
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
| |||
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
242 | | - | |
243 | | - | |
| 242 | + | |
| 243 | + | |
244 | 244 | | |
245 | 245 | | |
246 | 246 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
227 | 260 | | |
228 | 261 | | |
229 | 262 | | |
| |||
269 | 302 | | |
270 | 303 | | |
271 | 304 | | |
272 | | - | |
273 | | - | |
274 | | - | |
| 305 | + | |
275 | 306 | | |
276 | 307 | | |
277 | 308 | | |
| 309 | + | |
278 | 310 | | |
279 | 311 | | |
280 | 312 | | |
281 | 313 | | |
282 | | - | |
| 314 | + | |
283 | 315 | | |
284 | 316 | | |
285 | 317 | | |
| |||
292 | 324 | | |
293 | 325 | | |
294 | 326 | | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
295 | 367 | | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
296 | 375 | | |
297 | | - | |
| 376 | + | |
298 | 377 | | |
299 | 378 | | |
300 | 379 | | |
| |||
0 commit comments