Skip to content

Conversation

@Ansonhkg
Copy link
Collaborator

@Ansonhkg Ansonhkg commented Oct 17, 2025

WHAT

  • replace plain Error throws in node request flows with request id and Lit Error type.
  • Node operations (pkpSign, decrypt, executeJs, session key signing) now emit request id in the error, letting users share a requestId for log correlation.
  • (❗️Note) This PR contains a patch changeset

@Ansonhkg Ansonhkg self-assigned this Oct 17, 2025
Copilot AI review requested due to automatic review settings October 17, 2025 20:42
Copy link
Contributor

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

This PR replaces plain Error throws in node request flows with request IDs and Lit Error types to improve error tracking and debugging.

  • Systematically replaces Error constructors with typed error classes (NodeError, LitNodeClientBadConfigError, etc.)
  • Adds request ID tracking to error messages and structured error information
  • Updates function signatures to accept and pass through request IDs for better error traceability

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
executeJs.ts Updates error handling in executeJs flow to use NodeError with request ID tracking
E2EERequestManager.ts Replaces Error throws with NodeError/LitNodeClientBadConfigError and adds request ID parameter to error handling functions
E2EERequestManager.spec.ts Adds unit test to verify request ID inclusion in error messages
APIFactory.ts Updates API factory methods to use typed errors and pass request IDs to error handlers
BaseModuleFactory.ts Converts plain Error throws to appropriate Lit error types with structured error information
createLitClient.ts Replaces Error constructors with typed errors (LitNodeClientNotReadyError, ParamsMissingError, etc.)

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

jitContext: NagaJitContext,
operationName: string
operationName: string,
requestId: string
Copy link

Copilot AI Oct 17, 2025

Choose a reason for hiding this comment

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

The parameter requestId changed from optional (requestId?: string) to required (requestId: string) without updating the function signature documentation. This is a breaking change that could cause compilation errors in existing code that calls this function without providing a requestId.

Suggested change
requestId: string
requestId?: string

Copilot uses AI. Check for mistakes.
Comment on lines +50 to +53
interface DecryptBatchResponseOptions {
requestId?: string;
operationName?: string;
}
Copy link

Copilot AI Oct 17, 2025

Choose a reason for hiding this comment

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

The new interface DecryptBatchResponseOptions lacks JSDoc documentation explaining its purpose and parameter meanings, especially since it's used in a generic function that could be called from multiple contexts.

Copilot uses AI. Check for mistakes.
@Ansonhkg Ansonhkg requested a review from Copilot October 17, 2025 21:27
Copy link
Contributor

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

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@Ansonhkg Ansonhkg merged commit 3b8d247 into naga Oct 30, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants