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

NFT event subscribe is not robust #15

Closed
amiller opened this issue Sep 12, 2024 · 3 comments
Closed

NFT event subscribe is not robust #15

amiller opened this issue Sep 12, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@amiller
Copy link
Contributor

amiller commented Sep 12, 2024

If the subscribe loop crashes, then it reaches a zombie state.

NFTs can be minted by the backend, but they fail to be promoted from “pending” to ready.
Then they can’t be spent at all even if the backend restarts.

The subscribe loop failing seems to happen occasionally when a tweet response fails to decode.

Example log message:

2024-09-11T22:12:48Z INFO  alloy_pubsub::service] Pubsub service request channel closed. Shutting down.
called `Result::unwrap()` on an `Err` value: error decoding response body: missing field `data` at line 1 column 112
Caused by:
    missing field `data` at line 1 column 112
Location:
    src/twitter.rs:110:45
stack backtrace:
   0:          0xbc67ef5 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h1b9dad2a88e955ff
   1:          0xbc8e33b - core::fmt::write::h4b5a1270214bc4a7
   2:          0xbc64eff - std::io::Write::write_fmt::hd04af345a50c312d
   3:          0xbc691f1 - std::panicking::default_hook::{{closure}}::h96ab15e9936be7ed
   4:          0xbc68ecc - std::panicking::default_hook::h3cacb9c27561ad33
   5:          0xbc69851 - std::panicking::rust_panic_with_hook::hfe205f6954b2c97b
   6:          0xbc696b7 - std::panicking::begin_panic_handler::{{closure}}::h6cb44b3a50f28c44
...

@amiller amiller added the bug Something isn't working label Sep 12, 2024
@amiller
Copy link
Contributor Author

amiller commented Sep 13, 2024

i thought missing data field is in nft event subscribe, but it could be this line... an uncaught error here would indeed crash the pubsub thread

let tweet_response: SendTweetResponse = resp.json().await?;

@amiller amiller assigned amiller and unassigned amiller and rpalakkal Sep 13, 2024
@amiller
Copy link
Contributor Author

amiller commented Sep 13, 2024

[2024-09-13T12:21:14Z INFO teleport::oai] gpt-4o response: "safe"
thread 'tokio-runtime-worker' panicked at src/twitter.rs:111:6:
Failed to parse SendTweetResponse: "{"detail":"You are not permitted to perform this action.","type":"about:blank","title":"Forbidden","status":
403}": Error("missing field data", line: 1, column: 112)

@amiller amiller added this to the stop dropping oauths milestone Oct 6, 2024
@amiller
Copy link
Contributor Author

amiller commented Oct 6, 2024

Fixed in #17

@amiller amiller closed this as completed Oct 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants