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/image loading errors #858

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

bitbeckers
Copy link
Contributor

  • Added 400 error to CORS when URL missing
  • Added catch to html2canvas async call
  • Error loggin and toast

@vercel
Copy link

vercel bot commented Jun 20, 2023

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

Name Status Preview Comments Updated (UTC)
opensource-observer ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 20, 2023 5:54pm

@bitbeckers bitbeckers temporarily deployed to testing June 20, 2023 17:49 — with GitHub Actions Inactive
@bitbeckers bitbeckers marked this pull request as ready for review June 21, 2023 15:59
@@ -516,7 +522,18 @@ const exportAsImage = async (id: string) => {
//useCORS: true,
proxy: "https://cors-proxy.hypercerts.workers.dev/",
imageTimeout: 0,
}).catch((e) => {
Copy link
Member

Choose a reason for hiding this comment

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

Are we sure that html2canvas will throw an error if fetching the image fails? Worth some testing either manually or via unit/integration tests.

Copy link
Member

Choose a reason for hiding this comment

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

Actually now that I think about it, I don't think this solves the issue, because without the catch any thrown errors should stop everything. Instead the behavior we see is that the hypercert mints anyway with the broken images.

So catching is insufficient....

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep found the same during testing rn. I'm going to think about an alternative route. Because it's not like the canvas will be empty (that'd be easy to check), it's missing one specific layer

});

if (!canvas) {
return undefined;
Copy link
Member

Choose a reason for hiding this comment

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

Probably should show an error message?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

+1

@Jipperism
Copy link
Contributor

Moving this PR to #1145 as this has become stale.

@benedictvscriticus benedictvscriticus added the p0:urgent Must address immediately label Oct 30, 2023
@benedictvscriticus
Copy link

@holkeb have you heard anything about this?

@benedictvscriticus benedictvscriticus removed the p0:urgent Must address immediately label Dec 4, 2023
@benedictvscriticus
Copy link

Moving to backlog until further notice, as no requests or messages relating to this issue came to our attention since work was commenced on this.

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.

[FE][CORS-PROXY] Image generation should fail if CORS proxy can't fetch images
4 participants