fix: inline package.json descriptions in app-store _metadata.ts to fix Vitest RPC errors#27931
Conversation
…x Vitest RPC errors Co-Authored-By: alex@cal.com <me@alexvanandel.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
There was a problem hiding this comment.
2 issues found across 22 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="packages/app-store/larkcalendar/_metadata.ts">
<violation number="1" location="packages/app-store/larkcalendar/_metadata.ts:6">
P2: Inline user-facing description text should be localized via `t()` rather than embedded as a raw string so translations stay centralized.</violation>
</file>
<file name="packages/app-store/stripepayment/_metadata.ts">
<violation number="1" location="packages/app-store/stripepayment/_metadata.ts:7">
P3: Inline description text should be localized with t() (and added to the source locale) instead of embedding the raw string in metadata, since this description is rendered in the app store UI.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Devin AI is addressing Cubic AI's review feedbackNew feedback has been sent to the existing Devin session. |
|
Re: Cubic AI feedback — Both issues have confidence 6/10 (below the 9/10 threshold). These descriptions were already raw strings in |
What does this PR do?
Fixes Vitest unhandled rejection errors during test runs:
Root cause: 22 app-store
_metadata.tsfiles usedimport _package from "./package.json"to pull in thedescriptionfield. In Vitest's module runner, JSON imports trigger an RPC-based module fetch. When test workers shut down before all these fetches resolve, Vitest reports unhandled rejections — producing false positive test failures.Fix: Inline the
description(and in one case,name) string literals directly into each_metadata.tsfile, removing the./package.jsonimport entirely. Values were copied verbatim from each app'spackage.json.Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
Run the full unit test suite and confirm the "Closing rpc while fetch was pending" errors no longer appear:
TZ=UTC yarn testBefore this change, the test run reports
8 errorsincluding multiple instances of the RPC error originating from_metadata.tsfiles. After this change, those specific errors should be gone.Human Review Checklist
package.json: Each description string was copied from the corresponding app'spackage.json. Spot-check a few to confirm no transcription errors (e.g.huddle01video,wipemycalother,office365calendar).wipemycalothername field: This was the only file also using_package.name. Verify"WipeMyCal"matches thenamefield inwipemycalother/package.json.import process from "node:process"additions: The biome pre-commit hook auto-added explicitprocessimports indailyvideo,googlecalendar,googlevideo, andstripepayment(files that useprocess.env). These were not manual edits — verify they are acceptable.package.jsonand_metadata.ts. Consider whetherpackage.jsondescriptions should be removed or if this duplication is acceptable.