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

[bug](snap): queryCredentials function calling failing #624

Open
aditya9729 opened this issue Apr 11, 2024 · 1 comment
Open

[bug](snap): queryCredentials function calling failing #624

aditya9729 opened this issue Apr 11, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@aditya9729
Copy link

aditya9729 commented Apr 11, 2024

Describe the bug

We are using masca connector version 1.1.0 in our dapp. In Chrome, we see that when we enableMasca and try to query a particular credentialSubject Type or even query all credentials, queryCredentials promise doesn't resolve and gives us an error : {success:False, error:'Object[object]'}, its not very clear what's the error. Note we are behind corporate VPN and have seen that disabling usage of ceramic credential store doesn't help.

Code below:
`
const enableResult = await enableMasca(address,
{ snapId: 'npm:@blockchain-lab-um/masca',
version: '1.1.0',
supportedMethods: ['did:key'] }
);

    if (isError(enableResult)) {
      throw new Error(enableResult.message);
    }

    const mascaApi = await enableResult.data.getMascaApi();
    const getMethod = await mascaApi.getSelectedMethod();

    if (getMethod !== "did:key") {
      await mascaApi.switchDIDMethod('did:key');
      
    }
    const query = `$[?(@.data.credentialSubject.type == "credentialX")]`;
    const vcs = await mascaApi.queryCredentials({
        filter: {
            type: 'JSONPath',
            filter: query,
        },
        options: {
            returnStore: true,
        },
    });

`

To Reproduce

  1. Connect to a VPN server
  2. Use masca-connector version 1.1.0
  3. Build a basic dapp a provide access masca snap
  4. You should be able to give access to your ethereum address.
  5. Ethereum address is fed to enableMasca function call to a specific version with supported did methods being only 'did:key'
  6. Now when you queryCredentials, you should see the promise doesn't resolve and you get an error that doesn't tell you anything.

Expected behavior

Maybe its because of packet filtering, when we are behind the VPN, what version of masca connector should we use? What addresses should we whitelist such that we don't see metamask RPC timeout errors or even promise resolution errors?

@aditya9729 aditya9729 added the bug Something isn't working label Apr 11, 2024
@aditya9729 aditya9729 changed the title [bug](snap): queryCredentials function calling issue [bug](snap): queryCredentials function calling failing Apr 11, 2024
@pseudobun
Copy link
Member

Hi @aditya9729!

It looks to me like the issue could be related to MetaMask/snaps#2324. Are you testing Masca on localhost? One of the solutions to this specific problem is using ngrok temporarily until the MM team has fixed this.

Additionally as of today the latest connector shouldn't have been causing any more problems so you can update the masca-connector to v1.3.2.

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