Skip to content

fix(windows): preserve SQLite strings and roll back failed commits - #1336

Closed
OskarEichler wants to merge 1 commit into
react-native-async-storage:mainfrom
OskarEichler:codex/asyncstorage-windows-sqlite
Closed

fix(windows): preserve SQLite strings and roll back failed commits#1336
OskarEichler wants to merge 1 commit into
react-native-async-storage:mainfrom
OskarEichler:codex/asyncstorage-windows-sqlite

Conversation

@OskarEichler

@OskarEichler OskarEichler commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Use explicit SQLite string lengths, handle empty batches and retain transaction ownership until COMMIT succeeds.

Compatibility / observable behavior

Embedded-NUL strings are no longer truncated; empty reads/removals return empty/success instead of asserting; failed commits roll back. No schema change. This does not migrate values already truncated by prior writes.

Related to #1331. This is a focused part of a source review; it does not claim the entire repository is bug-free.

Test Plan

  • Compiled actual portable C++ helpers and MultiGet/MultiSet/MultiRemove/GetAllKeys against in-memory SQLite on macOS. Embedded-NUL keys/values remain distinct and round-trip; only the requested key is removed; empty batches succeed; deferred-constraint COMMIT failure rolls back. Baseline reproduces truncation, assertion and dangling transaction.
  • Upstream yarn build:js, yarn test:ts (6 tasks), yarn test:lint (6 tasks), yarn test:format and git diff --check pass on the combined review checkout.
  • No checked-in test/spec files changed. Reproductions were isolated and used synthetic data, not production/user storage.
  • The combined 3.1.1 backport passes consumer immutable install/lint, both products' Android Debug and iOS Simulator Debug builds, four production Metro bundles, 13 web targets and four browser-extension targets. Published native framework binaries are unchanged. React Doctor: 100/100.
  • Shared-storage testAndroidHostTest, macosArm64Test and iosSimulatorArm64Test pass with Java 21. The first Android run used Java 17 and failed Robolectric's SDK 36/JDK check; rerunning with the project's documented JDK fixed the environment failure without a source workaround.
  • Windows/WinRT runtime, signed releases and physical-device behavior have not been verified locally.

@changeset-bot

changeset-bot Bot commented Aug 27, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d8dbb6e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@react-native-async-storage/async-storage Patch

Not sure what this means? Click here to learn what changesets are.

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

@krizzu

krizzu commented Aug 31, 2026

Copy link
Copy Markdown
Member

again, this is legacy implementation that is currently rolling in v2. I don't want to touch it in v3

@krizzu krizzu closed this Aug 31, 2026
@OskarEichler

Copy link
Copy Markdown
Contributor Author

Understood—thanks for clarifying. I’ll leave the legacy Windows implementation unchanged across the v2/v3 transition.

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