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

Error in response causes new requests to not be processed. #4707

Open
antondalgren opened this issue Jun 27, 2024 · 3 comments
Open

Error in response causes new requests to not be processed. #4707

antondalgren opened this issue Jun 27, 2024 · 3 comments
Labels
type: bug Something isn't working

Comments

@antondalgren
Copy link
Contributor

antondalgren commented Jun 27, 2024

Describe the bug
If there is an error in the SDK after we have sent a response to a request, it is not possible to process a new request until that one has expired.

If any of these send methods throws an error, the cleanup method isn't called and the engine will not have it's state changed from active to idle and thus it will block any new request from being processed.

await this.sendResult({ id, topic, result: response.result, throwOnFailedPublish: true });
} else if (isJsonRpcError(response)) {
await this.sendError({ id, topic, error: response.error });
}
this.cleanupAfterResponse(params);

I have experienced this error to be thrown locally:

this.client.logger.error(`sendError() -> history.get(${topic}, ${id}) failed`);
throw error;

I'm not sure if the intention is that we are supposed to handle the error in this case or if there is something to be added to the SDK to ensure that the message has been transmitted successfully.

SDK Version (if relevant)

  • Client: [e.g. JS, Swift, Kotlin]
  • Version [e.g. 22]

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context

Error Logs:

 DEBUG  {"context": "core/relayer", "level": 20, "msg": "Incoming Relay Payload", "time": 1719495803262}
 DEBUG  {"context": "core/relayer", "level": 20, "msg": "Emitting Relayer Payload", "time": 1719495803264}
 DEBUG  {"context": "core/history", "level": 20, "msg": "Setting JSON-RPC request history record", "time": 1719495803275}
 LOG  {"context": "core/history", "level": 30, "msg": "Emitting history_created", "time": 1719495803281}
 DEBUG  {"context": "core/history", "event": "history_created", "level": 20, "record": {"chainId": undefined, "expiry": 1722087803, "id": 1719495803137475, "request": {"method": "wc_sessionRequest", "params": [Object]}, "topic": "3667ab5e15ad9f7ef0e90b1e30430982dada5483458ce8b4c6ba35698d8f1c88"}, "time": 1719495803281, "type": "event"}
 INFO  {"context": "client"} Request queue starting with 1 requests
 DEBUG  {"context": "client"} Getting value
 DEBUG  {"context": "client"} Getting value
 DEBUG  {"context": "client"} Getting value
 LOG  {"context": "core/verify-api", "level": 30, "msg": "resolving attestation: baf071a31eda0e67bc4471514eab8ac0e39fddba27a782e26994a6d78bf44cdd from url: https://verify.walletconnect.com", "time": 1719495803287}
 INFO  {"context": "client"} Verify context: {"verified":{"verifyUrl":"https://verify.walletconnect.com","validation":"UNKNOWN","origin":"UNKNOWN"}}
 LOG  {"context": "core/expirer", "level": 30, "msg": "Emitting expirer_created", "time": 1719495803386}
 DEBUG  {"context": "core/expirer", "data": {"expiration": {"expiry": 1719496103, "target": "id:1719495803137475"}, "target": "id:1719495803137475"}, "event": "expirer_created", "level": 20, "time": 1719495803387, "type": "event"}
 DEBUG  {"context": "client"} Setting value
 DEBUG  {"context": "client"} Getting value
 DEBUG  {"context": "client"} Getting value
 DEBUG  {"context": "core/history", "level": 20, "msg": "Getting record", "time": 1719495807790}
 ERROR  {"context": "client"} sendError() -> history.get(3667ab5e15ad9f7ef0e90b1e30430982dada5483458ce8b4c6ba35698d8f1c88, 1719495803137475) failed
 ERROR  {"context": "client"} No matching key. history: 1719495803137475
@antondalgren antondalgren added the type: bug Something isn't working label Jun 27, 2024
Copy link

linear bot commented Jun 27, 2024

@antondalgren
Copy link
Contributor Author

From the logs, it looks like the call to persist fails/is slow since later when trying to read from history it fails to find the entry.

@HananINouman
Copy link

hey @antondalgren, did you find a solution for this? I am using rainbowkit and encountering same error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants