Skip to content

fix(app): support arbitrary web storage keys - #9265

Merged
mikehardy merged 1 commit into
invertase:mainfrom
OskarEichler:codex/app-web-safe-key-storage
Sep 1, 2026
Merged

fix(app): support arbitrary web storage keys#9265
mikehardy merged 1 commit into
invertase:mainfrom
OskarEichler:codex/app-web-safe-key-storage

Conversation

@OskarEichler

Copy link
Copy Markdown
Contributor

What this fixes

  • Prevents web event names such as hasOwnProperty from replacing the listener map method and crashing subsequent listener operations.
  • Preserves event and preference keys such as __proto__ instead of silently losing them through JavaScript prototype behavior.
  • Stops eventsGetListeners() callers from mutating the internal listener registry.

These names are valid strings at the bridge boundary and native maps already support them.

Implementation

The web shim now stores string-keyed data in null-prototype dictionaries, performs explicit own-property checks, and returns detached null-prototype snapshots.

Verification

Exact baseline regressions failed with a TypeError and a lost preference value. All permanent focused cases now pass. Complete repository gates also pass:

  • yarn lerna:prepare
  • yarn tests:jest --runInBand — 103 suites, 1,482 tests, 31 snapshots
  • yarn tsc:compile
  • yarn tsc:compile:consumer
  • yarn lint:deps
  • yarn reference:api
  • yarn compare:types
  • focused ESLint
  • git diff --check

Compatibility

No public API/type or breaking change. Ordinary event and preference keys retain their existing behavior.

@mikehardy mikehardy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hey @OskarEichler 👋

Thanks for the PR - this looks like a real problem to me. I ran local Jest/unit plus the android/ios/macos e2e suite against it here and it came out clean. Pending CI, then I'll merge.

Cheers

@mikehardy mikehardy added the Workflow: Pending Merge Waiting on CI or similar label Aug 31, 2026
@codecov

codecov Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.71429% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 69.05%. Comparing base (9f27842) to head (44a3dfe).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #9265      +/-   ##
============================================
+ Coverage     68.60%   69.05%   +0.45%     
- Complexity     2096     2097       +1     
============================================
  Files           403      443      +40     
  Lines         22710    25522    +2812     
  Branches       4097     4256     +159     
============================================
+ Hits          15579    17622    +2043     
- Misses         5725     6525     +800     
+ Partials       1406     1375      -31     
Flag Coverage Δ
android-native 65.07% <ø> (+0.01%) ⬆️
e2e-ts-android 54.15% <ø> (+0.06%) ⬆️
e2e-ts-ios 53.62% <ø> (?)
e2e-ts-macos 49.88% <57.15%> (?)
ios-ruby 100.00% <ø> (?)
jest 47.37% <57.15%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mikehardy
mikehardy force-pushed the codex/app-web-safe-key-storage branch from 80afb37 to 44a3dfe Compare September 1, 2026 11:55
@mikehardy
mikehardy merged commit c2c9f42 into invertase:main Sep 1, 2026
24 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Workflow: Pending Merge Waiting on CI or similar

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants