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

Add header to get public images. Cut source links. #115

Merged
merged 2 commits into from
Jul 15, 2023

Conversation

tedspare
Copy link
Collaborator

All thanks to @tommoor for this fix 🙌

Summary

  • Use the new public-file-urls-expire-in header to fetch Linear markdown with public image URLs
  • Remove image source links and their swapping logic

Test Plan

  • Open a ticket with an image to the issue markdown via Linear. Ensure the image renders on GitHub.
  • Edit the ticket with more images. Ensure new and old images render on GitHub.
  • Repeat from GitHub. Ensure the image renders on Linear (there is some flash of "could not load image" before it re-uploads)

Related Issues

Closes #114

@tedspare tedspare requested a review from PeerRich July 15, 2023 04:05
@tedspare tedspare merged commit 728ef29 into main Jul 15, 2023
1 check passed
@@ -18,6 +18,9 @@ export const LINEAR = {
todo: "Todo",
done: "Done",
canceled: "Canceled"
},
PUBLIC_QUERY_HEADERS: {
"public-file-urls-expire-in": "86400"
Copy link

Choose a reason for hiding this comment

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

I'm not sure what the behavior of the GitHub cache is, if we see that the images start to break after a day then you may want to increase this value.

@milospuac
Copy link

Great stuff, this will help me a ton 🙏🏻🫡

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.

Linear-hosted images do not render on GitHub
3 participants