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

sdk hooks returns Expected array of to have exactly one item error #434

Closed
1 task done
jsonpreet opened this issue Jul 19, 2023 · 9 comments
Closed
1 task done

Comments

@jsonpreet
Copy link

jsonpreet commented Jul 19, 2023

Describe the bug
Hi,

Please look at the attached screenshots.

253753644-98548cf8-4788-4668-907d-585ac20bb0ab 253753609-cdae2473-8f56-4892-948c-47b4bd5c9508

Screenshot 2023-07-19 111419

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

  • React Web App

Version of the packages you are using
1.2.1

@jsonpreet jsonpreet changed the title useFeed returns Expected array of to have exactly one item error sdk hooks returns Expected array of to have exactly one item error Jul 19, 2023
@cesarenaldi
Copy link
Member

@jsonpreet the informations provided are not enough to understand the issue can you please clarify in what circumstances this error happens?

@jsonpreet
Copy link
Author

@cesarenaldi Sir I am using useFeed hook and whenever I visit or reload the page (Where I am using this hook) I got the above (attached) error.

@cesarenaldi
Copy link
Member

it looks like a malformed decryption criteria leaked into the indexed data. Can you please give me a full JSON copy of the network response you have in dev tools for the feed request?

@jsonpreet
Copy link
Author

{

    "operationName":"GetPublications",
    "variables":{
        "profileId":"0x013cee",
        "observerId":"0x016efc",
        "limit":20,
        "metadata":{
        },
        "sources":[
        ]
    },
    "query":"query GetPublications($profileId: ProfileId, $observerId: ProfileId, $limit: LimitScalar!, $cursor: Cursor, $publicationTypes: [PublicationTypes!], $sources: [Sources!]!, $metadata: PublicationMetadataFilters, $commentsOf: InternalPublicationId, $walletAddress: EthereumAddress) {\n result: publications(\n request: {profileId: $profileId, limit: $limit, collectedBy: $walletAddress, cursor: $cursor, publicationTypes: $publicationTypes, commentsOf: $commentsOf, sources: $sources, metadata: $metadata}\n ) {\n items {\n ... on Post {\n ...Post\n __typename\n }\n ... on Mirror {\n ...Mirror\n __typename\n }\n ... on Comment {\n ...Comment\n __typename\n }\n __typename\n }\n pageInfo {\n ...PaginatedResultInfo\n __typename\n }\n __typename\n }\n}\n\nfragment Post on Post {\n __typename\n id\n stats {\n ...PublicationStats\n __typename\n }\n metadata {\n ...MetadataOutput\n __typename\n }\n profile {\n ...Profile\n __typename\n }\n collectedBy {\n ...Wallet\n __typename\n }\n collectModule {\n ... on AaveFeeCollectModuleSettings {\n ...AaveFeeCollectModuleSettings\n __typename\n }\n ... on ERC4626FeeCollectModuleSettings {\n ...Erc4626FeeCollectModuleSettings\n __typename\n }\n ... on MultirecipientFeeCollectModuleSettings {\n ...MultirecipientFeeCollectModuleSettings\n __typename\n }\n ... on UnknownCollectModuleSettings {\n ...UnknownCollectModuleSettings\n __typename\n }\n ... on FreeCollectModuleSettings {\n ...FreeCollectModuleSettings\n __typename\n }\n ... on FeeCollectModuleSettings {\n ...FeeCollectModuleSettings\n __typename\n }\n ... on LimitedFeeCollectModuleSettings {\n ...LimitedFeeCollectModuleSettings\n __typename\n }\n ... on LimitedTimedFeeCollectModuleSettings {\n ...LimitedTimedFeeCollectModuleSettings\n __typename\n }\n ... on RevertCollectModuleSettings {\n ...RevertCollectModuleSettings\n __typename\n }\n ... on TimedFeeCollectModuleSettings {\n ...TimedFeeCollectModuleSettings\n __typename\n }\n ... on SimpleCollectModuleSettings {\n ...SimpleCollectModuleSettings\n __typename\n }\n __typename\n }\n collectNftAddress\n referenceModule {\n ... on FollowOnlyReferenceModuleSettings {\n ...FollowOnlyReferenceModuleSettings\n __typename\n }\n ... on DegreesOfSeparationReferenceModuleSettings {\n ...DegreesOfSeparationReferenceModuleSettings\n __typename\n }\n ... on UnknownReferenceModuleSettings {\n ...UnknownReferenceModuleSettings\n __typename\n }\n __typename\n }\n createdAt\n hidden\n isGated\n reaction(request: {profileId: $observerId})\n hasCollectedByMe\n canComment(profileId: $observerId) {\n result\n __typename\n }\n canMirror(profileId: $observerId) {\n result\n __typename\n }\n mirrors(by: $observerId)\n canObserverDecrypt: canDecrypt(profileId: $observerId) {\n result\n reasons\n __typename\n }\n}\n\nfragment PublicationStats on PublicationStats {\n __typename\n totalAmountOfMirrors\n totalUpvotes\n totalDownvotes\n totalAmountOfCollects\n totalAmountOfComments\n commentsCount: commentsTotal(forSources: $sources)\n}\n\nfragment MetadataOutput on MetadataOutput {\n __typename\n animatedUrl\n content\n contentWarning\n description\n image\n locale\n mainContentFocus\n name\n media {\n ...MediaSet\n __typename\n }\n attributes {\n ...MetadataAttributeOutput\n __typename\n }\n encryptionParams {\n ...EncryptionParamsOutput\n __typename\n }\n tags\n}\n\nfragment MediaSet on MediaSet {\n __typename\n original {\n ...Media\n __typename\n }\n}\n\nfragment Media on Media {\n __typename\n altTag\n cover\n mimeType\n url\n}\n\nfragment MetadataAttributeOutput on MetadataAttributeOutput {\n __typename\n traitType\n value\n}\n\nfragment EncryptionParamsOutput on EncryptionParamsOutput {\n __typename\n accessCondition {\n ...RootConditionOutput\n __typename\n }\n encryptionProvider\n encryptedFields {\n ...EncryptedFieldsOutput\n __typename\n }\n providerSpecificParams {\n encryptionKey\n __typename\n }\n}\n\nfragment RootConditionOutput on AccessConditionOutput {\n __typename\n or {\n criteria {\n ...AnyConditionOutput\n __typename\n }\n __typename\n }\n}\n\nfragment AnyConditionOutput on AccessConditionOutput {\n __typename\n ...LeafConditionOutput\n or {\n ...OrConditionOutput\n __typename\n }\n and {\n ...AndConditionOutput\n __typename\n }\n}\n\nfragment LeafConditionOutput on AccessConditionOutput {\n __typename\n nft {\n ...NftOwnershipOutput\n __typename\n }\n token {\n ...Erc20OwnershipOutput\n __typename\n }\n eoa {\n ...EoaOwnershipOutput\n __typename\n }\n profile {\n ...ProfileOwnershipOutput\n __typename\n }\n follow {\n ...FollowConditionOutput\n __typename\n }\n collect {\n ...CollectConditionOutput\n __typename\n }\n}\n\nfragment NftOwnershipOutput on NftOwnershipOutput {\n __typename\n contractAddress\n chainID\n contractType\n tokenIds\n}\n\nfragment Erc20OwnershipOutput on Erc20OwnershipOutput {\n __typename\n amount\n chainID\n condition\n contractAddress\n decimals\n name\n symbol\n}\n\nfragment EoaOwnershipOutput on EoaOwnershipOutput {\n __typename\n address\n}\n\nfragment ProfileOwnershipOutput on ProfileOwnershipOutput {\n __typename\n profileId\n}\n\nfragment FollowConditionOutput on FollowConditionOutput {\n __typename\n profileId\n}\n\nfragment CollectConditionOutput on CollectConditionOutput {\n __typename\n publicationId\n thisPublication\n}\n\nfragment OrConditionOutput on OrConditionOutput {\n __typename\n criteria {\n ...LeafConditionOutput\n __typename\n }\n}\n\nfragment AndConditionOutput on AndConditionOutput {\n __typename\n criteria {\n ...LeafConditionOutput\n __typename\n }\n}\n\nfragment EncryptedFieldsOutput on EncryptedFieldsOutput {\n __typename\n animation_url\n content\n external_url\n image\n media {\n original {\n ...EncryptedMedia\n __typename\n }\n __typename\n }\n}\n\nfragment EncryptedMedia on EncryptedMedia {\n __typename\n altTag\n cover\n mimeType\n url\n}\n\nfragment Profile on Profile {\n __typename\n id\n name\n bio\n handle\n ownedBy\n interests\n picture {\n ... on NftImage {\n ...NftImage\n __typename\n }\n ... on MediaSet {\n ...MediaSet\n __typename\n }\n __typename\n }\n coverPicture {\n ... on NftImage {\n ...NftImage\n __typename\n }\n ... on MediaSet {\n ...MediaSet\n __typename\n }\n __typename\n }\n stats {\n ...ProfileStats\n __typename\n }\n followModule {\n ... on FeeFollowModuleSettings {\n ...FeeFollowModuleSettings\n __typename\n }\n ... on ProfileFollowModuleSettings {\n ...ProfileFollowModuleSettings\n __typename\n }\n ... on RevertFollowModuleSettings {\n ...RevertFollowModuleSettings\n __typename\n }\n ... on UnknownFollowModuleSettings {\n ...UnknownFollowModuleSettings\n __typename\n }\n __typename\n }\n __attributes: attributes {\n ...Attribute\n __typename\n }\n dispatcher {\n address\n canUseRelay\n __typename\n }\n onChainIdentity {\n proofOfHumanity\n ens {\n name\n __typename\n }\n sybilDotOrg {\n verified\n source {\n twitter {\n handle\n __typename\n }\n __typename\n }\n __typename\n }\n worldcoin {\n isHuman\n __typename\n }\n __typename\n }\n isFollowedByMe\n isFollowingObserver: isFollowing(who: $observerId)\n}\n\nfragment NftImage on NftImage {\n __typename\n contractAddress\n tokenId\n uri\n verified\n}\n\nfragment ProfileStats on ProfileStats {\n __typename\n totalCollects\n totalComments\n totalFollowers\n totalFollowing\n totalMirrors\n totalPosts\n totalPublications\n commentsCount: commentsTotal(forSources: $sources)\n postsCount: postsTotal(forSources: $sources)\n mirrorsCount: mirrorsTotal(forSources: $sources)\n}\n\nfragment FeeFollowModuleSettings on FeeFollowModuleSettings {\n __typename\n amount {\n ...ModuleFeeAmount\n __typename\n }\n contractAddress\n recipient\n}\n\nfragment ModuleFeeAmount on ModuleFeeAmount {\n __typename\n asset {\n ...Erc20Fields\n __typename\n }\n value\n}\n\nfragment Erc20Fields on Erc20 {\n __typename\n name\n symbol\n decimals\n address\n}\n\nfragment ProfileFollowModuleSettings on ProfileFollowModuleSettings {\n __typename\n contractAddress\n}\n\nfragment RevertFollowModuleSettings on RevertFollowModuleSettings {\n __typename\n contractAddress\n}\n\nfragment UnknownFollowModuleSettings on UnknownFollowModuleSettings {\n __typename\n contractAddress\n}\n\nfragment Attribute on Attribute {\n __typename\n displayType\n key\n value\n}\n\nfragment Wallet on Wallet {\n __typename\n address\n defaultProfile {\n ...Profile\n __typename\n }\n}\n\nfragment AaveFeeCollectModuleSettings on AaveFeeCollectModuleSettings {\n __typename\n amount {\n ...ModuleFeeAmount\n __typename\n }\n collectLimitOptional: collectLimit\n contractAddress\n followerOnly\n endTimestampOptional: endTimestamp\n recipient\n referralFee\n}\n\nfragment Erc4626FeeCollectModuleSettings on ERC4626FeeCollectModuleSettings {\n __typename\n amount {\n ...ModuleFeeAmount\n __typename\n }\n collectLimitOptional: collectLimit\n contractAddress\n followerOnly\n endTimestampOptional: endTimestamp\n recipient\n referralFee\n vault\n}\n\nfragment MultirecipientFeeCollectModuleSettings on MultirecipientFeeCollectModuleSettings {\n __typename\n amount {\n ...ModuleFeeAmount\n __typename\n }\n collectLimitOptional: collectLimit\n contractAddress\n followerOnly\n endTimestampOptional: endTimestamp\n recipients {\n recipient\n split\n __typename\n }\n referralFee\n}\n\nfragment UnknownCollectModuleSettings on UnknownCollectModuleSettings {\n __typename\n contractAddress\n collectModuleReturnData\n}\n\nfragment FreeCollectModuleSettings on FreeCollectModuleSettings {\n __typename\n contractAddress\n followerOnly\n}\n\nfragment FeeCollectModuleSettings on FeeCollectModuleSettings {\n __typename\n amount {\n ...ModuleFeeAmount\n __typename\n }\n contractAddress\n followerOnly\n recipient\n referralFee\n}\n\nfragment LimitedFeeCollectModuleSettings on LimitedFeeCollectModuleSettings {\n __typename\n amount {\n ...ModuleFeeAmount\n __typename\n }\n collectLimit\n contractAddress\n followerOnly\n recipient\n referralFee\n}\n\nfragment LimitedTimedFeeCollectModuleSettings on LimitedTimedFeeCollectModuleSettings {\n __typename\n amount {\n ...ModuleFeeAmount\n __typename\n }\n collectLimit\n contractAddress\n followerOnly\n endTimestamp\n recipient\n referralFee\n}\n\nfragment RevertCollectModuleSettings on RevertCollectModuleSettings {\n __typename\n contractAddress\n}\n\nfragment TimedFeeCollectModuleSettings on TimedFeeCollectModuleSettings {\n __typename\n amount {\n ...ModuleFeeAmount\n __typename\n }\n contractAddress\n followerOnly\n endTimestamp\n recipient\n referralFee\n}\n\nfragment SimpleCollectModuleSettings on SimpleCollectModuleSettings {\n __typename\n contractAddress\n followerOnly\n feeOptional: fee {\n amount {\n ...ModuleFeeAmount\n __typename\n }\n referralFee\n recipient\n __typename\n }\n collectLimitOptional: collectLimit\n endTimestampOptional: endTimestamp\n}\n\nfragment FollowOnlyReferenceModuleSettings on FollowOnlyReferenceModuleSettings {\n __typename\n contractAddress\n}\n\nfragment DegreesOfSeparationReferenceModuleSettings on DegreesOfSeparationReferenceModuleSettings {\n __typename\n contractAddress\n commentsRestricted\n degreesOfSeparation\n mirrorsRestricted\n}\n\nfragment UnknownReferenceModuleSettings on UnknownReferenceModuleSettings {\n __typename\n contractAddress\n referenceModuleReturnData\n}\n\nfragment Mirror on Mirror {\n __typename\n ...MirrorBase\n mirrorOf {\n ... on Post {\n ...Post\n __typename\n }\n ... on Comment {\n ...Comment\n __typename\n }\n __typename\n }\n}\n\nfragment MirrorBase on Mirror {\n __typename\n id\n createdAt\n profile {\n ...Profile\n __typename\n }\n hidden\n}\n\nfragment Comment on Comment {\n __typename\n ...CommentBase\n commentOn {\n ... on Post {\n ...Post\n __typename\n }\n ... on Mirror {\n ...MirrorBase\n __typename\n }\n ... on Comment {\n ...CommentBase\n __typename\n }\n __typename\n }\n mainPost {\n ... on Post {\n ...Post\n __typename\n }\n ... on Mirror {\n ...MirrorBase\n __typename\n }\n __typename\n }\n firstComment {\n ...CommentBase\n __typename\n }\n}\n\nfragment CommentBase on Comment {\n __typename\n id\n stats {\n ...PublicationStats\n __typename\n }\n metadata {\n ...MetadataOutput\n __typename\n }\n profile {\n ...Profile\n __typename\n }\n collectedBy {\n ...Wallet\n __typename\n }\n collectModule {\n ... on AaveFeeCollectModuleSettings {\n ...AaveFeeCollectModuleSettings\n __typename\n }\n ... on ERC4626FeeCollectModuleSettings {\n ...Erc4626FeeCollectModuleSettings\n __typename\n }\n ... on MultirecipientFeeCollectModuleSettings {\n ...MultirecipientFeeCollectModuleSettings\n __typename\n }\n ... on UnknownCollectModuleSettings {\n ...UnknownCollectModuleSettings\n __typename\n }\n ... on FreeCollectModuleSettings {\n ...FreeCollectModuleSettings\n __typename\n }\n ... on FeeCollectModuleSettings {\n ...FeeCollectModuleSettings\n __typename\n }\n ... on LimitedFeeCollectModuleSettings {\n ...LimitedFeeCollectModuleSettings\n __typename\n }\n ... on LimitedTimedFeeCollectModuleSettings {\n ...LimitedTimedFeeCollectModuleSettings\n __typename\n }\n ... on RevertCollectModuleSettings {\n ...RevertCollectModuleSettings\n __typename\n }\n ... on TimedFeeCollectModuleSettings {\n ...TimedFeeCollectModuleSettings\n __typename\n }\n ... on SimpleCollectModuleSettings {\n ...SimpleCollectModuleSettings\n __typename\n }\n __typename\n }\n collectNftAddress\n referenceModule {\n ... on FollowOnlyReferenceModuleSettings {\n ...FollowOnlyReferenceModuleSettings\n __typename\n }\n ... on DegreesOfSeparationReferenceModuleSettings {\n ...DegreesOfSeparationReferenceModuleSettings\n __typename\n }\n ... on UnknownReferenceModuleSettings {\n ...UnknownReferenceModuleSettings\n __typename\n }\n __typename\n }\n createdAt\n hidden\n isGated\n reaction(request: {profileId: $observerId})\n hasCollectedByMe\n canComment(profileId: $observerId) {\n result\n __typename\n }\n canMirror(profileId: $observerId) {\n result\n __typename\n }\n canObserverDecrypt: canDecrypt(profileId: $observerId) {\n result\n reasons\n __typename\n }\n mirrors(by: $observerId)\n}\n\nfragment PaginatedResultInfo on PaginatedResultInfo {\n __typename\n prev\n next\n totalCount\n}"

}

@jingledongding
Copy link

I have also encountered a similar issue. Please review my problem at: #436.

@cesarenaldi
Copy link
Member

An update here: #436 (comment)

@cesarenaldi
Copy link
Member

@jsonpreet a fix for this is now available in @1.2.2 and @next versions.

Please let me know so we can close this issue.

@cesarenaldi
Copy link
Member

@jsonpreet did you manage to try the fix on on of the versions mentioned above?

@jsonpreet
Copy link
Author

@cesarenaldi Yeah, it seems this issue is fixed. Thank You.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants