Skip to content

Allow undefined as ref param type#390

Merged
5ouma merged 1 commit intomainfrom
fix-src-ref-type
Mar 15, 2026
Merged

Allow undefined as ref param type#390
5ouma merged 1 commit intomainfrom
fix-src-ref-type

Conversation

@5ouma
Copy link
Owner

@5ouma 5ouma commented Mar 15, 2026

⚠️ Issue

close #


✏️ Description

Upstream Hono made that as a union.


Upstream Hono made that as a union.
Copilot AI review requested due to automatic review settings March 15, 2026 10:08
@github-actions github-actions bot added the 🧰 Bug A bug fix label Mar 15, 2026
Copy link

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

Updates the server route handler to reflect upstream Hono’s change where route params can be undefined for optional parameters, aligning the local typing with actual runtime behavior.

Changes:

  • Adjust ref route param typing from string to string | undefined for the optional /:ref? route.
  • Keep downstream calls (checkRedirect, getContent) consistent with their ref?: string signatures.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@coderabbitai
Copy link

coderabbitai bot commented Mar 15, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6aff027e-32e4-4bea-89f5-5d7c9cc9b4e4

📥 Commits

Reviewing files that changed from the base of the PR and between 21bc99d and b532f0f.

📒 Files selected for processing (1)
  • src/server.ts

Walkthrough

The type of the local variable ref in src/server.ts was changed from string to string | undefined to account for cases where the "ref" parameter may be absent. This type change propagates to downstream functions.

Changes

Cohort / File(s) Summary
Type annotation update
src/server.ts
Changed local variable ref type from string to string | undefined to reflect optional parameter; propagates to checkRedirect and getContent functions.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: updating the ref parameter type to allow undefined in addition to string.
Description check ✅ Passed The description explains the change is motivated by upstream Hono making the ref parameter a union type that includes undefined.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-src-ref-type
📝 Coding Plan
  • Generate coding plan for human review comments

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.

@5ouma 5ouma merged commit 5edac8e into main Mar 15, 2026
19 checks passed
@5ouma 5ouma deleted the fix-src-ref-type branch March 15, 2026 10:11
@5ouma 5ouma bot mentioned this pull request Mar 15, 2026
@codecov
Copy link

codecov bot commented Mar 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (21bc99d) to head (b532f0f).
⚠️ Report is 3 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #390   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            6         6           
  Lines          115       115           
  Branches         9         9           
=========================================
  Hits           115       115           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

🧰 Bug A bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants