Skip to content

Conversation

@allouis
Copy link
Collaborator

@allouis allouis commented Jun 2, 2025

ref https://linear.app/ghost/issue/PROD-1922

When we refactored to use awilix for dependency injection, the next parameter was mistakenly dropped from being passed to the webfinger handler.

ref https://linear.app/ghost/issue/PROD-1922

When we refactored to use awilix for dependency injection, the next parameter
was mistakenly dropped from being passed to the webfinger handler.
@coderabbitai
Copy link

coderabbitai bot commented Jun 2, 2025

Walkthrough

The change updates the handler function for the GET route at /.well-known/webfinger in the Hono app. The handler's signature is modified to accept both the request context and a next middleware function, instead of just the context. The invocation of the webFingerHandler is also updated to pass both arguments. No changes are made to exported or public entities; the modification is limited to the route's inline handler function signature and its invocation.

Possibly related PRs

  • Added custom webfinger handler #520: This PR introduced the custom webFingerHandler used in the /.well-known/webfinger route, making it directly relevant to the handler signature modification in the current change.

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 081924a and 3a57dfb.

📒 Files selected for processing (1)
  • src/app.ts (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/app.ts (1)
src/instrumentation.ts (1)
  • spanWrapper (50-62)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Build, Test and Push
🔇 Additional comments (1)
src/app.ts (1)

1241-1243:

Details

✅ Verification successful

LGTM! This correctly restores the missing next parameter.

The change properly addresses the issue where the next parameter was inadvertently omitted during the awilix refactor. The handler signature now correctly accepts both ctx: AppContext and next: Next, and the invocation passes both parameters to the webfinger handler.

To ensure this fix is complete and doesn't introduce any type mismatches, let's verify that the createWebFingerHandler function actually returns a handler that expects both parameters:


🏁 Script executed:

#!/bin/bash
# Description: Verify that the webfinger handler expects both ctx and next parameters

# Search for the createWebFingerHandler function definition
ast-grep --pattern 'export function createWebFingerHandler($$$) {
  $$$
}'

# Also search for the function signature it returns
rg -A 10 "createWebFingerHandler" --type ts

Length of output: 14513


LGTM – Next parameter correctly restored and type-compatible

The createWebFingerHandler function returns an async middleware with signature (ctx: HonoContext, next: Next), and existing unit tests invoke handleWebFinger(ctx, next), confirming both parameters are accepted. This aligns with spanWrapper’s expectations and completes the bug fix.

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@allouis allouis merged commit 0c3f0eb into main Jun 2, 2025
9 checks passed
@allouis allouis deleted the fix-webfinger-handler branch June 2, 2025 13:22
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