Skip to content

Conversation

@crwen
Copy link
Contributor

@crwen crwen commented Sep 6, 2025

Which issue does this PR close?

Closes #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 ?

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:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhance OPFS Support: Read/Write, List, and Other

3 participants