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

BlobStorage should provide consistent behaviour #3245

Closed
JasperStardream opened this issue Jul 14, 2023 · 8 comments
Closed

BlobStorage should provide consistent behaviour #3245

JasperStardream opened this issue Jul 14, 2023 · 8 comments
Assignees
Labels
type:feat Non-bug feature improvements

Comments

@JasperStardream
Copy link
Contributor

JasperStardream commented Jul 14, 2023

The 'get' method of 'createIndexeddbStorage' returns the 'type' type. But, createSQLiteStorage and createStaticStorage do not. Please take time to add 'type' type.

Please let me know if it is completed. I need to remove the temporary code. toeverything/blocksuite#3555

@JasperStardream JasperStardream converted this from a draft issue Jul 14, 2023
@JasperStardream JasperStardream added the type:feat Non-bug feature improvements label Jul 14, 2023
@NextThread
Copy link

hey, I'd like to work on this issue

@JasperStardream
Copy link
Contributor Author

Thank you. It has been assigned to you. @NextThread

@NextThread
Copy link

@zuoxiaodong0815 i did, but somebody told me that, it's not necessary, this thing can be skipped

@JasperStardream
Copy link
Contributor Author

If we don't store the file type, we need to calculate the file type when reading the file, refer to the code https://github.com/toeverything/blocksuite/pull/3555/files
image
So storing file types is a bit more appropriate.

The following two blob-storage, one of which provides the file type and one of which does not
https://github.com/toeverything/blocksuite/blob/master/packages/store/src/persistence/blob/indexeddb-storage.ts
https://github.com/toeverything/AFFiNE/blob/master/packages/workspace/src/blob/sqlite-blob-storage.ts

@NextThread
Copy link

NextThread commented Aug 14, 2023

New PR #3729 @zuoxiaodong0815

@zhe-he
Copy link

zhe-he commented Nov 1, 2023

@zuoxiaodong0815
Hi, I noticed this issue because my editor keeps giving me warnings about the file-type module. Then I started trying to fix this problem. Since I'm not familiar with the business, if my approach is incorrect, please consider upgrading the file-type module so that my editor no longer gives the following warnings. Thank you in advance.

[plugin:vite:resolve] Module "events" has been externalized for browser compatibility, imported by "/Users/zhe-he/xxx/node_modules/readable-web-to-node-stream/node_modules/readable-stream/lib/_stream_readable.js". See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details

@fourdim
Copy link
Contributor

fourdim commented Jan 8, 2024

Hi, I noticed this issue because my editor keeps giving me warnings about the file-type module. Then I started trying to fix this problem. Since I'm not familiar with the business, if my approach is incorrect, please consider upgrading the file-type module so that my editor no longer gives the following warnings. Thank you in advance.

[plugin:vite:resolve] Module "events" has been externalized for browser compatibility, imported by "/Users/zhe-he/xxx/node_modules/readable-web-to-node-stream/node_modules/readable-stream/lib/_stream_readable.js". See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details

@zhe-he Hi, we are always dedicated to using the latest dependencies. The thing is, we cannot upgrade it to the latest version as it's latest version does not support browser. Please consider contributing to the package file-type, token-type, and readable-stream in order to eliminate this warning.

@EYHN EYHN moved this from 🆕 *Untriaged to ✅ Done in AFFiNE Project Mar 9, 2024
@affine-issue-bot
Copy link

Issue Status: ✅ Done

✅ Done

If the issue was a bug, it’s been fixed; if it was a missing feature, it’s been implemented.

This is an automatic reply by the bot.

@EYHN EYHN closed this as completed Mar 9, 2024
EYHN pushed a commit to toeverything/blocksuite that referenced this issue Apr 22, 2024
Fix toeverything/AFFiNE#6603

This pull request switches the [file-type](https://github.com/sindresorhus/file-type) to [@sgtpooki/file-type](https://github.com/sgtpooki/file-type).

It also includes other minor changes and updates.

~~The `file-type` is no longer useful since the toeverything/AFFiNE#3245 resolved in toeverything/AFFiNE#5565

---

More context see toeverything/AFFiNE#3245 #3555 #4818 #5372 sindresorhus/file-type#578

---

## Caveat

The [@sgtpooki/file-type](https://github.com/sgtpooki/file-type) is an unofficial fork package from the community. It may need to be source code audited before updating.

Also, thanks to sgtpooki for their strong contribution to @sgtpooki/file-type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feat Non-bug feature improvements
Projects
Archived in project
Development

No branches or pull requests

6 participants