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

fix(files): avoid duplicated fetch during preview #2254

Merged
merged 3 commits into from
Sep 3, 2024

Conversation

lidel
Copy link
Member

@lidel lidel commented Aug 31, 2024

Preview

Can be tested with big txt file, like bafybeicbevt3gr2jhs23f2sikwcqtirrhrdyscriutfg5mtlxoud55htii

2024-08-31_02-14

@lidel lidel requested a review from SgtPooki August 31, 2024 00:28
@lidel lidel requested a review from a team as a code owner August 31, 2024 00:28
@lidel lidel mentioned this pull request Aug 31, 2024
34 tasks
@@ -214,7 +214,7 @@ const actions = () => ({
...fileFromStats({ ...stats, path }),
fetched: time,
type: 'file',
read: () => ipfs.cat(stats.cid),
read: (offset, length) => ipfs.cat(stats.cid, { offset, length }),
Copy link
Member

Choose a reason for hiding this comment

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

nit: this CI action is failing but this is not a TS file.. we could add jsdoc..

do we want to disable typecheck CI while we are not full typescript?

Copy link
Member Author

Choose a reason for hiding this comment

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

Let's keep it, we get contributions from people, and better if they include types (easier for us to review).
I've added jsdoc.

src/files/file-preview/FilePreview.js Outdated Show resolved Hide resolved
Co-authored-by: Russell Dempsey <1173416+SgtPooki@users.noreply.github.com>
@lidel lidel merged commit eefae25 into main Sep 3, 2024
22 checks passed
@lidel lidel deleted the fix/optimized-preview-fetch branch September 3, 2024 21:56
ipfs-gui-bot pushed a commit that referenced this pull request Sep 23, 2024
## [4.3.1](v4.3.0...v4.3.1) (2024-09-23)

 CID `bafybeideglc722hiwhsy4kiyl2fivf5lr6wozy2iuixtgzkvl3v4hasaty`

 ---

### Bug Fixes

* **file-preview:** safeSubresourceGwUrl ([#2253](#2253)) ([bb861a3](bb861a3)), closes [/github.com//issues/2246#issuecomment-2322192398](https://github.com/ipfs//github.com/ipfs/ipfs-webui/issues/2246/issues/issuecomment-2322192398)
* **files:** avoid duplicated fetch during preview ([#2254](#2254)) ([eefae25](eefae25)), closes [#2217](#2217)
* **files:** prefer subdomain gw in copied share links ([#2255](#2255)) ([e8c4421](e8c4421))

### Trivial Changes

* .io → .tech ([b9f622d](b9f622d))
* browserslist@latest ([#2251](#2251)) ([809c55a](809c55a))
* Pull transifex translations ([#2258](#2258)) ([2250374](2250374))
* use ipld-explorer-components@7.0.2 ([#2257](#2257)) ([99ba9ac](99ba9ac))
@ipfs-gui-bot
Copy link
Collaborator

🎉 This PR is included in version 4.3.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

Files: video/image bytes are loaded twice on preview page
3 participants