Skip to content

fix: allow writes through shared table handles - #20

Merged
RandomChirp merged 1 commit into
FoxDevCommunity:mainfrom
edname:codex/shared-table-write
Oct 5, 2026
Merged

RandomChirp merged 1 commit into
FoxDevCommunity:mainfrom
edname:codex/shared-table-write

Conversation

@edname

@edname edname commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Allow writes through shared table handles

Related to #12.

Opening a table with exclusive=false currently selects a read-only file
descriptor (r). A subsequent tableService.write() fails with EBADF, even
when the file is writable. Shared access and read-only access are separate concerns.

Attempt r+ for both modes and keep the existing fallback to r with
writable=false when writable access is denied.

Regression tests use temporary files and check exact bytes on disk for shared
and exclusive opens. A POSIX permissions test covers the read-only fallback.
The shared-write case fails with EBADF before this change and passes afterward.

Validation on macOS arm64:

  • Main-process tests: 30 passed, 5 Windows-only tests skipped.
  • Focused ESLint, TypeScript checks and production build passed.

This addresses a reproducible descriptor-level cause of EBADF. I have not
reproduced the full Windows INSERT scenario in #12 or its missing-fiber error.
This change does not implement shared-table locking; Windows runtime validation
and concurrency behavior remain separate checks.

Developed with AI assistance. Regression tests passed on macOS; the full Windows scenario remains unverified.

@RandomChirp
RandomChirp merged commit 6038b10 into FoxDevCommunity:main Oct 5, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants