Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task creation fails with CANCELLED error when using API key authentication #15

Open
chrisli30 opened this issue Nov 1, 2024 · 0 comments
Labels
P2 Priority 2 testing Test cases related issue

Comments

@chrisli30
Copy link
Member

Expected Behavior

  • Task creation should succeed when authenticated with API key and using a smart wallet address
  • Should return a successful response with a task ID

Current Behavior

  • The API call is being cancelled with error: "1 CANCELLED: Call cancelled"
  • Test fails due to unexpected RPC cancellation

Test Details

test("should create a task when authenticated with API key", async () => {
  const result = await client.createTask({
    address: smartWallet,
    tokenContract: TOKEN_CONTRACT,
    oracleContract: ORACLE_CONTRACT,
  });
  expect(result).toBeDefined();
  expect(result).toHaveProperty("id");
});

Test Trace

 FAIL  tests/createTask.test.ts
  listTasks Tests
    Auth with API key
      ✕ should create a task when authenticated with API key (199 ms)

  ● listTasks Tests › Auth with API key › should create a task when authenticated with API key

    1 CANCELLED: Call cancelled

      4576 |   _callRPC(method, request) {
      4577 |     return new Promise((resolve, reject) => {
    > 4578 |       this.rpcClient[method].bind(this.rpcClient)(
           |                                                  ^
      4579 |         request,
      4580 |         this.metadata,
      4581 |         (error, response) => {

Reproduction Steps

  1. Run npx jest tests/createTask.test.ts -t "should create a task when authenticated with API key"
  2. Observe that the gRPC call is cancelled unexpectedly

Additional Context

  • The error occurs in the gRPC client layer
  • This might indicate an issue with the API key authentication or connection handling
  • The test passes when using signature authentication, suggesting this is specific to API key auth
@chrisli30 chrisli30 added P2 Priority 2 testing Test cases related issue labels Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 Priority 2 testing Test cases related issue
Projects
None yet
Development

No branches or pull requests

1 participant