Skip to content

fix(dev): resolve 25 check-types errors across feed, packs, packTemplates, wildlife#2057

Closed
andrew-bierman wants to merge 0 commit into
developmentfrom
fix/dev-check-types
Closed

fix(dev): resolve 25 check-types errors across feed, packs, packTemplates, wildlife#2057
andrew-bierman wants to merge 0 commit into
developmentfrom
fix/dev-check-types

Conversation

@andrew-bierman
Copy link
Copy Markdown
Collaborator

@andrew-bierman andrew-bierman commented Apr 11, 2026

Summary

Hotfix. bun run check-types on 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.parentCommentId without 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 across packs, packTemplates, feed, and related routes. Adding an AnyPgColumn return type on the references() callback breaks the cycle and restores normal inference. No runtime change.

Changes (5 commits)

  1. fix(api): resolve recursive type inference in postComments self-reference — fixes ~20 downstream errors.
  2. fix(api): align feed schema and routes with zod-openapi types — adds missing 400 response on add-comment, replaces example: null with example: undefined on an optional int in the feed schema.
  3. fix(api): pass getPresignedUrl options as object in wildlife route — wildlife identify was calling getPresignedUrl with 3 positional args instead of the (ctx, { command, signOptions }) shape.
  4. fix(expo): use valid SF Symbol icon names in home tile and feed componentsIcon name="delete" is not in the @roninoss/icons allowlist. Replaced with trash-can-outline. Also fixed a stale import path for assertIsString to use @packrat/guards.
  5. fix(expo/feed): move biome-ignore comment to key prop in PostDetailScreen — pre-existing suppression was placed above <Image> instead of the key prop, so it had no effect and biome still errored in CI.

Error count

  • Before: 28 check-types errors
  • After: 0 check-types errors
  • Biome check: was failing on a pre-existing misplaced suppression, now clean

Test plan

  • bun run check-types exits 0
  • bun biome check --diagnostic-level=error exits 0
  • Pre-commit hook passes on each commit
  • CI green

Copilot AI review requested due to automatic review settings April 11, 2026 13:08
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 11, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 554a19de-ec09-4695-9c8d-d63f50a84182

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/dev-check-types

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 11, 2026

Coverage Report for Expo Unit Tests Coverage (./apps/expo)

Status Category Percentage Covered / Total
🔵 Lines 74.32% 495 / 666
🔵 Statements 74.32% (🎯 75%) 495 / 666
🔵 Functions 90.9% 50 / 55
🔵 Branches 91.34% 190 / 208
File CoverageNo changed files found.
Generated in workflow #83 for commit b19fd68 by the Vitest Coverage Report Action

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 11, 2026

Coverage Report for API Unit Tests Coverage (./packages/api)

Status Category Percentage Covered / Total
🔵 Lines 89.66% 902 / 1006
🔵 Statements 89.66% (🎯 80%) 902 / 1006
🔵 Functions 97.95% 48 / 49
🔵 Branches 89.74% 280 / 312
File CoverageNo changed files found.
Generated in workflow #83 for commit b19fd68 by the Vitest Coverage Report Action

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.parentCommentId to 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 assertIsString import 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.

Comment thread packages/api/src/schemas/feed.ts Outdated
.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 }),
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
parentCommentId: z.number().int().optional().openapi({ example: undefined }),
parentCommentId: z.number().int().optional(),

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants