Skip to content

Conversation

Copy link

Copilot AI commented Jan 19, 2026

Lite PR

Summary

  • Returning response from an route handler in ENSApi can be now streamlined with resultIntoHttpResponse function, that produces a HTTP Response object based on the provided operation result.
  • Operation result pattern has been applied to responses returned by:
    • Generic response handlers (i.e. onError, notFound)
    • GET /amirealtime endpoint
      • See related AmIRealtimeResult result type
    • Registrar Actions API endpoints
  • Added type-safe way to define routes descriptions for a given API
    • See buildRouteResponsesDescription function
  • Extended RESULT_CODE_SERVER_ERROR_CODES with ResultCodes.ServiceUnavailable
    • See related buildResultServiceUnavailable builder function and ResultServer type.

Why

  • This change integrates the result pattern that was introduced to ENSNode SDK in order to standardize ENSNode response data model.
  • "Explore APIs" are required to include minIndexingCursor field in their response data model to indicate to which point in time the response data is guaranteed to be up to.
  • Documentation for a HTTP endpoint should include all possible HTTP response codes and their meaning.

Testing

  • Ran all typechecks and testing suites.
  • Tested /amirealtime and /api/registrar-actions endpoints locally, simulating conditions where both, ok and error results were returned from ENSApi.

Notes for Reviewer (Optional)

  • This PR is a demonstration of a particular design for making Registrar Actions API to use the result pattern from ENSNode SDK. The implementation may change depending on the feedback.

Pre-Review Checklist (Blocking)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@changeset-bot
Copy link

changeset-bot bot commented Jan 19, 2026

⚠️ No Changeset found

Latest commit: 50e5f6b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Jan 19, 2026

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

3 Skipped Deployments
Project Deployment Review Updated (UTC)
admin.ensnode.io Skipped Skipped Jan 19, 2026 9:29am
ensnode.io Skipped Skipped Jan 19, 2026 9:29am
ensrainbow.io Skipped Skipped Jan 19, 2026 9:29am

@coderabbitai
Copy link

coderabbitai bot commented Jan 19, 2026

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch copilot/sub-pr-1545

Comment @coderabbitai help to get the list of available commands and usage tips.

@vercel vercel bot temporarily deployed to Preview – admin.ensnode.io January 19, 2026 09:29 Inactive
@vercel vercel bot temporarily deployed to Preview – ensrainbow.io January 19, 2026 09:29 Inactive
@vercel vercel bot temporarily deployed to Preview – ensnode.io January 19, 2026 09:29 Inactive
Copilot AI changed the title [WIP] Refactor ENSApi to apply operation result pattern refactor(ensapi): apply operation result pattern Jan 19, 2026
Copilot AI requested a review from tk-o January 19, 2026 09:33
@tk-o tk-o closed this Jan 19, 2026
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