Skip to content

RU-T50 Build fix#255

Merged
ucswift merged 1 commit into
masterfrom
develop
Jul 24, 2026
Merged

RU-T50 Build fix#255
ucswift merged 1 commit into
masterfrom
develop

Conversation

@ucswift

@ucswift ucswift commented Jul 24, 2026

Copy link
Copy Markdown
Member

Description

This PR fixes a build issue caused by the upstream app-icon-badge Expo config plugin, which started image file writes without awaiting their completion. This could lead to unreadable or partially written icon files during the build process.

Key changes:

  1. Replaced the app-icon-badge plugin (app.config.ts) — Switched from the upstream package to a custom local plugin (./plugins/with-app-icon-badge.js).

  2. Added a custom config plugin (plugins/with-app-icon-badge.js) — Creates badge generation tasks for the general app icon, iOS icon, and Android adaptive icon, then runs them synchronously via a child process so Expo blocks until all icons are fully generated and validated.

  3. Added a badge generator script (plugins/generate-app-icon-badges.js) — Generates badged icons with a retry mechanism that waits until each generated image file is fully written and readable (up to 200 attempts) before proceeding, preventing race conditions during the build.

  4. Refactored CheckInTimerStatus type (src/lib/check-in-timer-utils.ts) — Derives the status union type directly from the STATUS_COLORS constant, improving type consistency and reducing duplication.

@Resgrid-Bot

Resgrid-Bot commented Jul 24, 2026

Copy link
Copy Markdown

Code Review Completed! 🔥

The code review was successfully completed based on your current configurations.

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Validate Business Logic: Ask Kody to validate your code against business rules by adding a comment with the @kody -v business-logic command.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug
Performance
Security
Business Logic

Access your configuration settings here.

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@ucswift, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 59 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c82988da-0f3d-4e50-b8f0-4a07a8c0a69c

📥 Commits

Reviewing files that changed from the base of the PR and between 8243113 and f59e653.

📒 Files selected for processing (4)
  • app.config.ts
  • plugins/generate-app-icon-badges.js
  • plugins/with-app-icon-badge.js
  • src/lib/check-in-timer-utils.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch develop

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.

@ucswift

ucswift commented Jul 24, 2026

Copy link
Copy Markdown
Member Author

Approve

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This PR is approved.

@ucswift
ucswift merged commit acf8280 into master Jul 24, 2026
20 checks passed

main().catch((error) => {
const message = error instanceof Error ? (error.stack ?? error.message) : String(error);
process.stderr.write(`${path.basename(__filename)}: ${message}\n`);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

kody code-review Kody Rules high

Unstructured error logging occurs because process.stderr.write emits a plain text string without debugging identifiers during multi-task failures. Emit structured JSON output containing fields like { op, error, destinationPath, sourcePath } instead of a flat string.

Kody rule violation: Include error context in structured logs

Prompt for LLM

File plugins/generate-app-icon-badges.js:

Line 60:

Unstructured error logging occurs because `process.stderr.write` emits a plain text string without debugging identifiers during multi-task failures. Emit structured JSON output containing fields like `{ op, error, destinationPath, sourcePath }` instead of a flat string.

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

Comment on lines +53 to +55
for (const task of payload.tasks) {
await generateBadge(task);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

kody code-review Kody Rules low

Sequential task execution bottleneck occurs because the first await loop failure aborts all remaining independent badge tasks. Use await Promise.allSettled(payload.tasks.map(generateBadge)) to attempt all tasks, collect per-task errors, and report them together.

Kody rule violation: Use Promise.allSettled for batch operations with partial failures

Prompt for LLM

File plugins/generate-app-icon-badges.js:

Line 53 to 55:

Sequential task execution bottleneck occurs because the first `await` loop failure aborts all remaining independent badge tasks. Use `await Promise.allSettled(payload.tasks.map(generateBadge))` to attempt all tasks, collect per-task errors, and report them together.

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

});
};

const withAppIconBadge = (config, options = {}) => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

kody code-review Kody Rules high

Render performance degradation occurs because .bind() or inline arrow functions in JSX props create new function instances on every render. Move function definitions outside the render method to resolve the performance impact.

Kody rule violation: Avoid using .bind() or arrow functions in JSX props

Prompt for LLM

File plugins/with-app-icon-badge.js:

Line 25:

Render performance degradation occurs because `.bind()` or inline arrow functions in JSX props create new function instances on every render. Move function definitions outside the render method to resolve the performance impact.

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

Comment on lines +19 to +22
execFileSync(process.execPath, [GENERATOR_SCRIPT, JSON.stringify({ tasks })], {
cwd: projectRoot,
stdio: 'inherit',
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

kody code-review Kody Rules high

Opaque build failures occur because the execFileSync call spawns an external child process without a try/catch, violating rule [28] for mapped application-level errors. Wrap the call in try/catch, log the projectRoot and task count, and rethrow an actionable error.

Also found in:

  • plugins/generate-app-icon-badges.js:36-36
  • plugins/generate-app-icon-badges.js:38-43
  • plugins/generate-app-icon-badges.js:37-37

Kody rule violation: Add try-catch blocks for external calls

Prompt for LLM

File plugins/with-app-icon-badge.js:

Line 19 to 22:

Opaque build failures occur because the `execFileSync` call spawns an external child process without a try/catch, violating rule [28] for mapped application-level errors. Wrap the call in try/catch, log the `projectRoot` and task count, and rethrow an actionable error.

**Also found in:**
- `plugins/generate-app-icon-badges.js:36-36`
- `plugins/generate-app-icon-badges.js:38-43`
- `plugins/generate-app-icon-badges.js:37-37`

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants