Skip to content

Conversation

@samuelstroschein
Copy link
Member

Closes opral/lix-sdk#332

Summary

  • Replace path-based OPFS API with explicit factories.
  • Add name→id index and enforce id/name invariants.
  • Make open() single‑flight to avoid race conditions.

Key Changes

  • Factories: OpfsStorage.byId(id), OpfsStorage.byName(name), OpfsStorage.list().
  • Path API removal: new OpfsStorage({ path }) is no longer supported.
  • Index: lix_opfs_storage.json maps name → id; files persist as <id>.lix.
  • Invariants:
    • byId throws if DB lix_id ≠ requested id.
    • byName does not mutate lix_name on existing files; updates index to DB’s lix_id.
  • Concurrency: open() is single‑flight to prevent duplicate init/writes.
  • Validation: Reject invalid ids/names (only [A-Za-z0-9_-] allowed).

Migration

  • Replace new OpfsStorage({ path: ${id}.lix }) with:
    • OpfsStorage.byId(id) when you have an id
    • OpfsStorage.byName(name) when you want to open by name

@changeset-bot
Copy link

changeset-bot bot commented Aug 30, 2025

⚠️ No Changeset found

Latest commit: 70b02dc

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@samuelstroschein samuelstroschein temporarily deployed to lixdk-425-opfs-adapter-findbyname-and-openbyid-etc - lix-docs PR #3687 August 30, 2025 20:20 — with Render Destroyed
@samuelstroschein samuelstroschein temporarily deployed to lixdk-425-opfs-adapter-findbyname-and-openbyid-etc - prosemirror-example PR #3687 August 30, 2025 20:20 — with Render Destroyed
@samuelstroschein samuelstroschein temporarily deployed to lixdk-425-opfs-adapter-findbyname-and-openbyid-etc - flashtype.ai PR #3687 August 30, 2025 20:20 — with Render Destroyed
@nx-cloud
Copy link

nx-cloud bot commented Aug 30, 2025

🤖 Nx Cloud AI Fix Eligible

An automatically generated fix could have helped fix failing tasks for this run, but Self-healing CI is disabled for this workspace. Visit workspace settings to enable it and get automatic fixes in future runs.

To disable these notifications, a workspace admin can disable them in workspace settings.


View your CI Pipeline Execution ↗ for commit 70b02dc

Command Status Duration Result
nx run-many --target=test --parallel ❌ Failed 8m 57s View ↗
nx run-many --target=lint --parallel ✅ Succeeded 46s View ↗

☁️ Nx Cloud last updated this comment at 2025-08-30 20:31:45 UTC

@github-actions github-actions bot locked and limited conversation to collaborators Sep 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

opfs adapter findByName and openById etc

2 participants