Skip to content

fix(electron): accept explicit undefined in RPC payloads - #220

Merged
Nat3z merged 1 commit into
mainfrom
t3code/fix-fiber-parse-errors
Aug 5, 2026
Merged

fix(electron): accept explicit undefined in RPC payloads#220
Nat3z merged 1 commit into
mainfrom
t3code/fix-fiber-parse-errors

Conversation

@Nat3z

@Nat3z Nat3z commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • Allow explicit undefined values in optional Electron RPC payload fields.
  • Add schema coverage for optional positional arguments across RPC procedures.

Testing

  • bun test application/tests/electron-rpc-schema.test.ts

Summary by CodeRabbit

  • Bug Fixes

    • Improved handling of optional values in Electron RPC requests, preventing valid operations from being rejected when optional fields are explicitly left undefined.
  • Tests

    • Added coverage for optional arguments across app updates, Real-Debrid operations, and download requests.

- Add regression coverage for optional positional RPC arguments
@Nat3z

Nat3z commented Aug 5, 2026

Copy link
Copy Markdown
Owner Author

Review complete for PR #220.

I've submitted my review as a GitHub PR review.

@vercel

vercel Bot commented Aug 5, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
open-game-installer-web Ready Ready Preview Aug 5, 2026 7:03am

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Changes

The Electron RPC schemas now accept explicit undefined for selected optional strings, numbers, and LibraryInfo fields. Tests cover representative app, Real-Debrid, and download payloads.

RPC Undefined Argument Support

Layer / File(s) Summary
Optional RPC schema contracts
application/src/lib/electron-rpc.ts
OptionalString, OptionalNumber, and selected app.updateAppVersion fields now accept explicit undefined.
RPC schema validation tests
application/tests/electron-rpc-schema.test.ts
Tests decode RPC payloads with explicit undefined optional arguments without throwing validation errors.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: nat-openclaw

Poem

A rabbit checks each RPC call,
Undefined passes through them all.
Strings and numbers hop in line,
App fields validate just fine.
Tests thump softly: green is bright!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: allowing explicit undefined values in Electron RPC payloads.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch t3code/fix-fiber-parse-errors

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.

@Nat3z

Nat3z commented Aug 5, 2026

Copy link
Copy Markdown
Owner Author

Review by @nat-openclaw

Summary

This is a focused, correct fix. Wrapping optional tuple elements with Schema.UndefinedOr matches Effect Schema’s semantics for positional optional args and aligns the RPC schemas with how callers already pass undefined (e.g. addToSteam(appID, oldSteamAppId) when oldSteamAppId is omitted). Omitted arguments still decode, null is still rejected, and handlers already treat these params as optional.

Verdict

0 critical, 0 important, 0 nits

What Looks Good

  • Minimal, targeted change: shared OptionalString / OptionalNumber helpers plus the two inline updateAppVersion optional opaque fields.
  • Matches real call sites (addToSteam, updateAppVersion, ddl.download, magnet RPCs) where TypeScript optional values become explicit undefined in the payload tuple.
  • New regression test covers re

Findings (0)

No findings.

@Nat3z

Nat3z commented Aug 5, 2026

Copy link
Copy Markdown
Owner Author

I hit an infra error before I could finish:

git worktree add -b pr-agent/pr-220-pr-220-1785913515272-5facuo /home/nat/github-pr-agent-work/Nat3z/OpenGameInstaller/.worktrees/pr-220-1785913515272-5facuo refs/remotes/pr-head-220/t3code/fix-fiber-parse-errors failed with 128
fatal: invalid reference: refs/remotes/pr-head-220/t3code/fix-fiber-parse-errors

React to this comment with 🚀 to retry.

@greptile-apps

greptile-apps Bot commented Aug 5, 2026

Copy link
Copy Markdown

Greptile Summary

The PR broadens optional Electron RPC tuple elements to accept explicit undefined values while preserving omission semantics.

  • Wraps optional string, number, UMU, and launch-environment fields with Schema.UndefinedOr.
  • Adds focused Bun schema tests for representative optional positional arguments.

Confidence Score: 5/5

The PR appears safe to merge with no actionable correctness or security issues identified.

The schema changes narrowly add explicit undefined to already optional tuple elements, and the affected handlers already support undefined optional values.

Important Files Changed

Filename Overview
application/src/lib/electron-rpc.ts Broadens affected optional positional schemas to accept explicit undefined, consistently with handlers that already treat these arguments as optional.
application/tests/electron-rpc-schema.test.ts Adds focused decoding coverage for explicit undefined across the affected RPC payload schemas.

Reviews (1): Last reviewed commit: "fix(electron): accept explicit undefined..." | Re-trigger Greptile

@Nat3z
Nat3z merged commit ac8e06a into main Aug 5, 2026
6 of 7 checks passed
@Nat3z
Nat3z deleted the t3code/fix-fiber-parse-errors branch August 5, 2026 07:05

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
application/tests/electron-rpc-schema.test.ts (1)

10-20: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add explicit undefined coverage for umu.

The updateAppVersion schema changed both LibraryInfo['umu'] and LibraryInfo['launchEnv']. This payload sets umu to an object and tests undefined only for launchEnv. Add a case with umu set to undefined so both changed fields are covered.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@application/tests/electron-rpc-schema.test.ts` around lines 10 - 20, Add
explicit coverage for an undefined umu value in the updateAppVersion
payloadSchema test. Add or adjust a test case using
ElectronRpc.app.updateAppVersion.payloadSchema so umu is undefined while
retaining the existing launchEnv undefined coverage.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@application/tests/electron-rpc-schema.test.ts`:
- Around line 10-20: Add explicit coverage for an undefined umu value in the
updateAppVersion payloadSchema test. Add or adjust a test case using
ElectronRpc.app.updateAppVersion.payloadSchema so umu is undefined while
retaining the existing launchEnv undefined coverage.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 6ccbc15a-cecc-44a8-8808-a318146f49d5

📥 Commits

Reviewing files that changed from the base of the PR and between 980074a and b88d104.

📒 Files selected for processing (2)
  • application/src/lib/electron-rpc.ts
  • application/tests/electron-rpc-schema.test.ts

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.

1 participant