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

usePublications failed to execute if one of publication on scope have an invalid encryption condition #926

Open
1 of 2 tasks
Djangoz1 opened this issue Apr 25, 2024 · 1 comment
Labels
Stale Flagged as stale

Comments

@Djangoz1
Copy link

Djangoz1 commented Apr 25, 2024

Describe the bug
With usePublications react hook, if profile post a publications encrypted with invalid currency object/address condition, we can't retrieve any publications and I can't retrieve publications at all

To Reproduce

  • Encrypted publication with invalid erc20OwnershipCondition(or erc721 maybe) condition with lensClient.gated
  • Post publication on arweave
  • Execute usePublications with publisher profile id on where.from for argument

Expected behaviuor
Perhaps a modifier would be needed to verify the validity of the conditions before encryption

If using the React bindings, what is the essence of your React app?

  • React Web App
  • React Native

Version of the packages you are using
"@lens-protocol/client": "2.0.0-alpha.37", "@lens-protocol/metadata": "^1.1.6", "@lens-protocol/react-web": "latest", "@lens-protocol/wagmi": "latest",`

Additional context
In all applications, the profile page returns UnspecifiedError:
{ "name": "ApolloError", "graphQLErrors": [ { "message": "Currency not found for contract 0xD13c7342e1ef687C5ad21b27c2b65D772cAb5C8c:137", "locations": [ { "line": 1782, "column": 3 } ], "path": [ "result", "items", 2, "metadata" ], "extensions": { "code": "GRAPHQL_VALIDATION_FAILED", "stacktrace": [ "GraphQLError: Currency not found for contract 0xD13c7342e1ef687C5ad21b27c2b65D772cAb5C8c:137", " at new ValidationError (/usr/src/app/packages/apollo-server-errors/lib/index.js:40:9)", " at getModuleCurrency (/usr/src/app/packages/api-lens/lib/currency/operations/get-module-currency.js:14:15)", " at process.processTicksAndRejections (node:internal/process/task_queues:95:5)", " at async Amount.fromValueAndCurrency (/usr/src/app/packages/api-lens/lib/shared/types/amount.js:35:23)", " at async Erc20OwnershipCondition.fromMetadataErc20OwnershipCondition (/usr/src/app/packages/api-lens/lib/shared/types/gated.js:86:25)", " at async Promise.all (index 1)", " at async OrCondition.fromMetadataSimpleConditionList (/usr/src/app/packages/api-lens/lib/shared/types/gated.js:286:27)", " at async Promise.all (index 1)", " at async RootCondition.fromMetadataRootConditionCriteria (/usr/src/app/packages/api-lens/lib/shared/types/gated.js:263:27)", " at async PublicationMetadataLitEncryption.fromPublicationMetadata (/usr/src/app/packages/api-lens/lib/publication/types/metadata.js:73:34)", " at async TextOnlyMetadataV3.resolveModernPublicationMetadata (/usr/src/app/packages/api-lens/lib/publication/types/metadata.js:159:32)", " at async TextOnlyMetadataV3.fromTextOnlyMetadata (/usr/src/app/packages/api-lens/lib/publication/types/metadata.js:877:24)" ] } } ], "message": "Currency not found for contract 0xD13c7342e1ef687C5ad21b27c2b65D772cAb5C8c:137" }

@cesarenaldi
Copy link
Member

@Djangoz1 thank you for reporting this issue. Can you please clarify "invalid currency object/address condition"? What makes it invalid?

Can you also clarify what you mean by "modifier" here?

Perhaps a modifier would be needed to verify the validity of the conditions before encryption

@cesarenaldi cesarenaldi added the Stale Flagged as stale label May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Stale Flagged as stale
Projects
None yet
Development

No branches or pull requests

2 participants