fix(dev): resolve 25 check-types errors across feed, packs, packTemplates, wildlife#2057
fix(dev): resolve 25 check-types errors across feed, packs, packTemplates, wildlife#2057andrew-bierman wants to merge 0 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Coverage Report for Expo Unit Tests Coverage (./apps/expo)
File CoverageNo changed files found. |
Coverage Report for API Unit Tests Coverage (./packages/api)
File CoverageNo changed files found. |
There was a problem hiding this comment.
Pull request overview
Hotfix to restore a clean bun run check-types state after recent merges introduced TypeScript/OpenAPI/Drizzle typing mismatches across the API feed + wildlife routes and Expo feed UI.
Changes:
- Fixed Drizzle self-referential FK typing for
postComments.parentCommentIdto avoid recursive inference issues. - Aligned API presigned-URL signing calls with the
getPresignedUrl(c, { command, signOptions })helper signature and expanded OpenAPI response typing for feed comments. - Updated Expo feed UI to use valid icon names and standardized
assertIsStringimport from@packrat/guards.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/api/src/schemas/feed.ts | Adjusts feed request/response Zod/OpenAPI schemas (comment request example updated). |
| packages/api/src/routes/wildlife/index.ts | Updates presigned URL generation to the options-object helper signature. |
| packages/api/src/routes/feed/comments.ts | Adds an OpenAPI-documented 400 response for comment creation. |
| packages/api/src/db/schema.ts | Fixes post_comments.parent_comment_id self-reference typing via AnyPgColumn. |
| apps/expo/features/feed/components/PostCard.tsx | Replaces invalid delete icon name; minor lint-directive placement adjustment in image map. |
| apps/expo/features/feed/components/CommentItem.tsx | Replaces invalid delete icon name. |
| apps/expo/app/(app)/(tabs)/(home)/index.tsx | Switches assertIsString import to @packrat/guards. |
| .object({ | ||
| content: z.string().min(1).max(1000).openapi({ example: 'Looks amazing!' }), | ||
| parentCommentId: z.number().int().optional().openapi({ example: null }), | ||
| parentCommentId: z.number().int().optional().openapi({ example: undefined }), |
There was a problem hiding this comment.
openapi({ example: undefined }) is not a valid JSON/OpenAPI example value (undefined cannot be represented in JSON). For an optional field, either omit the example entirely or provide a valid numeric example (and rely on optional() to indicate it may be absent).
| parentCommentId: z.number().int().optional().openapi({ example: undefined }), | |
| parentCommentId: z.number().int().optional(), |
b19fd68 to
e55ffb0
Compare
Summary
Hotfix.
bun run check-typeson development broke after #1882 (Social feed), #1885 (Trail Conditions iOS), #1906 (Offline Plant ID), and related PRs merged in rapid succession with pre-existing TS errors. This restores clean check-types and unbreaks biome in CI.Root cause
The single biggest win is the drizzle schema fix. #1882 added a self-referential FK on
postComments.parentCommentIdwithout an explicit column type annotation. TypeScript hit its recursion depth limit trying to infer the relation types for the table, collapsed every relation in the schema to{ [x: string]: any }, and that rippled into ~20 callsites acrosspacks,packTemplates,feed, and related routes. Adding anAnyPgColumnreturn type on thereferences()callback breaks the cycle and restores normal inference. No runtime change.Changes (5 commits)
fix(api): resolve recursive type inference in postComments self-reference— fixes ~20 downstream errors.fix(api): align feed schema and routes with zod-openapi types— adds missing 400 response on add-comment, replacesexample: nullwithexample: undefinedon an optional int in the feed schema.fix(api): pass getPresignedUrl options as object in wildlife route— wildlife identify was callinggetPresignedUrlwith 3 positional args instead of the(ctx, { command, signOptions })shape.fix(expo): use valid SF Symbol icon names in home tile and feed components—Icon name="delete"is not in the@roninoss/iconsallowlist. Replaced withtrash-can-outline. Also fixed a stale import path forassertIsStringto use@packrat/guards.fix(expo/feed): move biome-ignore comment to key prop in PostDetailScreen— pre-existing suppression was placed above<Image>instead of thekeyprop, so it had no effect and biome still errored in CI.Error count
check-typeserrorscheck-typeserrorsTest plan
bun run check-typesexits 0bun biome check --diagnostic-level=errorexits 0