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

Unable to Clear getListOfVerifyContexts() #1483

Open
ronaldoguedess opened this issue Aug 22, 2024 · 2 comments
Open

Unable to Clear getListOfVerifyContexts() #1483

ronaldoguedess opened this issue Aug 22, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@ronaldoguedess
Copy link

I've noticed that when a request can't be processed, it remains stored in the getListOfVerifyContexts() list, and there's no apparent way to clear it. This results in the list retaining records that should ideally be removed.

For example, in my case, the following contexts remain in the list and are never cleared:

[VerifyContext(id=1724284981409728, origin=https://malicious-app-verify-simulation.vercel.app, validation=VALID, verifyUrl=https://verify.walletconnect.org/, isScam=true), VerifyContext(id=1724286080110007, origin=https://malicious-app-verify-simulation.vercel.app, validation=VALID, verifyUrl=https://verify.walletconnect.org/, isScam=true)]

Questions:

  1. How can I clear this list?
  2. Why are these entries retained?
  3. Is this behavior intentional or a bug? Keeping these entries indefinitely seems unnecessary and could potentially lead to memory issues.

Reproduction Steps:

  1. Send a request of any type of transaction.
  2. Close the app suddenly while the modal is opened.
  3. Reopen the app and check the getListOfVerifyContexts() method.
@ronaldoguedess ronaldoguedess added the bug Something isn't working label Aug 22, 2024
@jakubuid
Copy link
Contributor

Hey! The VerifyContext for a given request is removed when the request is responded (approved/rejected). To get the list of pending session requests you can use getPendingListOfSessionRequests and allow users to respond to them when they e.g. reopen their app. Once they do the VerifyContext should be removed.

@ronaldoguedess
Copy link
Author

ronaldoguedess commented Aug 23, 2024

Hey! I understand that the information is usually removed during a normal flow, but as I mentioned, there are a few scenarios where the flow isn’t followed, causing this info to accumulate.

If I reopen the app after closing app with an opened modal without processing (reject/accept), that context will get stucked forever there.

The function you mentioned won’t work because it requires a topic, and getListOfVerifyContexts only provides IDs, not topics, look.

@Throws /* = Throws */(exceptionClasses = {java. lang. IllegalStateException::class})
public final fun getPendingListOfSessionRequests(
    topic: String
): List<Wallet. Model. SessionRequest>

Just so you understand, right now I have 38 VerifyContexts open, and I can't do anything about it...

[VerifyContext(id=1724284981409728, origin=https://malicious-app-verify-simulation.vercel.app, validation=VALID, verifyUrl=https://verify.walletconnect.org/, isScam=true), VerifyContext(id=1724286080110007, origin=https://malicious-app-verify-simulation.vercel.app, validation=VALID, verifyUrl=https://verify.walletconnect.org/, isScam=true), VerifyContext(id=1724288576939104, origin=https://malicious-app-verify-simulation.vercel.app, validation=VALID, verifyUrl=https://verify.walletconnect.org/, isScam=true), VerifyContext(id=1724288828963897, origin=https://malicious-app-verify-simulation.vercel.app, validation=VALID, verifyUrl=https://verify.walletconnect.org/, isScam=true), VerifyContext(id=1724289843535961, origin=https://malicious-app-verify-simulation.vercel.app, validation=VALID, verifyUrl=https://verify.walletconnect.org/, isScam=true), VerifyContext(id=1724290527487587, origin=, validation=UNKNOWN, verifyUrl=https://verify.walletconnect.org/, isScam=null), VerifyContext(id=1724292563857422, origin=https://react-app.walletconnect.com, validation=VALID, verifyUrl=https://verify.walletconnect.org/, isScam=false), VerifyContext(id=1724295282087940, origin=https://react-app.walletconnect.com, validation=VALID, verifyUrl=https://verify.walletconnect.org/, isScam=false), VerifyContext(id=1724295346942787, origin=https://react-app.walletconnect.com, validation=VALID, verifyUrl=https://verify.walletconnect.org/, isScam=false), VerifyContext(id=1724295428617741, origin=https://react-app.walletconnect.com, validation=VALID, verifyUrl=https://verify.walletconnect.org/, isScam=false), VerifyContext(id=1724295624884156, origin=https://react-app.walletconnect.com, validation=VALID, verifyUrl=https://verify.walletconnect.org/, isScam=false), VerifyContext(id=1724295735945080, origin=https://react-app.walletconnect.com, validation=VALID, verifyUrl=https://verify.walletconnect.org/, isScam=false), VerifyContext(id=1724295947300879, origin=https://react-app.walletconnect.com, validation=VALID, verifyUrl=https://verify.walletconnect.org/, isScam=false), VerifyContext(id=1724295956463870, origin=https://react-app.walletconnect.com, validation=VALID, verifyUrl=https://verify.walletconnect.org/, isScam=false), VerifyContext(id=1724295985633331, origin=https://react-app.walletconnect.com, validation=VALID, verifyUrl=https://verify.walletconnect.org/, isScam=false), VerifyContext(id=1724296057135682, origin=https://react-app.walletconnect.com, validation=VALID, verifyUrl=https://verify.walletconnect.org/, isScam=false), VerifyContext(id=1724296168556660, origin=https://react-app.walletconnect.com, validation=VALID, verifyUrl=https://verify.walletconnect.org/, isScam=false), VerifyContext(id=1724296266433225, origin=https://react-app.walletconnect.com, validation=VALID, verifyUrl=https://verify.walletconnect.org/, isScam=false), VerifyContext(id=1724296407357951, origin=https://react-app.walletconnect.com, validation=VALID, verifyUrl=https://verify.walletconnect.org/, isScam=false), VerifyContext(id=1724296516436572, origin=https://react-app.walletconnect.com, validation=VALID, verifyUrl=https://verify.walletconnect.org/, isScam=false), VerifyContext(id=1724296536294690, origin=https://react-app.walletconnect.com, validation=VALID, verifyUrl=https://verify.walletconnect.org/, isScam=false), VerifyContext(id=1724296681831859, origin=https://react-app.walletconnect.com, validation=VALID, verifyUrl=https://verify.walletconnect.org/, isScam=false), VerifyContext(id=1724296740312421, origin=https://react-app.walletconnect.com, validation=VALID, verifyUrl=https://verify.walletconnect.org/, isScam=false), VerifyContext(id=1724304201210902, origin=https://react-app.walletconnect.com, validation=VALID, verifyUrl=https://verify.walletconnect.org/, isScam=false), VerifyContext(id=1724306882863070, origin=https://react-app.walletconnect.com, validation=VALID, verifyUrl=https://verify.walletconnect.org/, isScam=false), VerifyContext(id=1724337445626020, origin=https://malicious- ...

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

No branches or pull requests

2 participants