Skip to content

Conversation

@crwen
Copy link
Contributor

@crwen crwen commented Sep 6, 2025

Which issue does this PR close?

Related to #5799.

Rationale for this change

What changes are included in this PR?

  • Add read/write/delete/list support for OPFS
  • Add some tests(I'm not sure if it's appropriate to place the tests to core/edge/opfs_on_wasm). These tests are basically copied from core/tests/behavior

Notice:

  • list with recursive is not implemented
  • only file stat is supported, directory stat return default metadata now

Are there any user-facing changes?

@crwen crwen requested a review from Xuanwo as a code owner September 6, 2025 14:55
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. releases-note/feat The PR implements a new feature or has a title that begins with "feat" labels Sep 6, 2025
os: ${{ matrix.os }}
cases: ${{ toJson(matrix.cases) }}

test_opfs:
Copy link
Member

Choose a reason for hiding this comment

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

Hi, opfs is a new service, and I didn’t expect it to be added as a new type for behavior tests.

Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure if we need to duplicate all the tests for WASM again.

# specific language governing permissions and limitations
# under the License.

name: OPFS Test
Copy link
Member

Choose a reason for hiding this comment

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

We can add opfs test as a new edge case under at https://github.com/apache/opendal/blob/main/.github/workflows/test_edge.yml


let (tx, rx) = mpsc::unbounded();

// everything in wasm-bindgen is non-send, so we need to spawn a new task
Copy link
Member

Choose a reason for hiding this comment

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

oio::Read and oio::List should be able to implemented in a non-Send way. I think we can avoid the those usage of channel. What's the problem we are facing now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since everything is non-Send and non-Sync under wasm, but Read requires Send + Sync, I can't hold any content related to wasm in OpfsReader.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we can remove read/write/list from this PR for now and open a new issue on how to implememt these without using channel. What do you think @Xuanwo ?

Copy link
Member

Choose a reason for hiding this comment

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

I think we can remove read/write/list from this PR for now and open a new issue on how to implememt these without using channel. What do you think @Xuanwo ?

Sorry for the late. And this plan looks good to me

@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:XXL This PR changes 1000+ lines, ignoring generated files. labels Dec 16, 2025
@crwen crwen marked this pull request as draft December 16, 2025 08:35
@crwen crwen force-pushed the feat/opfs branch 3 times, most recently from 8cfafd8 to 490d9a5 Compare December 16, 2025 10:53
@crwen crwen changed the title feat(services/opfs): add read/write/delete/list support for OPFS feat(services/opfs): add delete/stat support for OPFS Dec 16, 2025
@crwen crwen marked this pull request as ready for review December 16, 2025 14:06
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:XL This PR changes 500-999 lines, ignoring generated files. labels Dec 16, 2025
@crwen crwen requested a review from Xuanwo December 16, 2025 14:20
# Conflicts:
#	core/core/Cargo.toml
#	core/core/src/services/mod.rs
#	core/services/etcd/src/error.rs
#	core/services/opfs/src/backend.rs
#	core/services/opfs/src/builder.rs
#	core/services/opfs/src/core.rs
#	core/services/opfs/src/delete.rs
#	core/services/opfs/src/lib.rs
#	core/services/opfs/src/utils.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

releases-note/feat The PR implements a new feature or has a title that begins with "feat" size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants