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

feat: suspense support for usePublication hook #930

Merged
merged 1 commit into from
May 8, 2024

Conversation

krzysu
Copy link
Contributor

@krzysu krzysu commented May 2, 2024

No description provided.

Copy link

changeset-bot bot commented May 2, 2024

🦋 Changeset detected

Latest commit: b1cb9e7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@lens-protocol/react Minor
@lens-protocol/react-native Minor
@lens-protocol/react-web Minor
@lens-protocol/wagmi Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

height bot commented May 2, 2024

This pull request has been linked to 1 task:

💡Tip: Add "Close T-20234" to the pull request title or description, to a commit message, or in a comment to mark this task as "Done" when the pull request is merged.

Copy link

vercel bot commented May 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
lens-sdk-example-web-wagmi ✅ Ready (Inspect) Visit Preview May 2, 2024 11:52am

@@ -131,7 +131,7 @@ export function useSuspenseReadResult<TResult, TVariables extends OperationVaria
}

return {
data: data?.result ?? never('Data should be available in suspense mode.'),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

both profile and publication queries can return NULL and that's a valid response

loading: false,
};
}
// if (request.forId && !isValidPublicationId(request.forId)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is a problem, that with wrong publicationId the API returns error, but it's not handled anywhere so it's thrown in the example app, would it make sense to do simple publicationId validation, the same as on the API side? the other thing is, it is not possible before useSuspendableQuery hook and later is too late as the API error is already thrown. any idea?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or that use case shouldn't really exist? I made this UI and it breaks badly when using a wrong publication Id https://lens-sdk-example-web-wagmi-q0w3lfali-avaraxyz.vercel.app/publications/usePublication

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to me this is a case of wrong usage, a wrong Id (from a format perspective) to me should throw.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I rebased my branch on top of this one. I polished this aspect there. Will merge both now.

@cesarenaldi cesarenaldi merged commit 9eab6cb into develop May 8, 2024
6 checks passed
@cesarenaldi cesarenaldi deleted the T-20234/usepublication branch May 8, 2024 12:05
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

Successfully merging this pull request may close these issues.

2 participants