Skip to content

fix(app): preserve memidb event listeners - #9270

Merged
mikehardy merged 1 commit into
invertase:mainfrom
OskarEichler:codex/app-memidb-listener-removal
Sep 1, 2026
Merged

fix(app): preserve memidb event listeners#9270
mikehardy merged 1 commit into
invertase:mainfrom
OskarEichler:codex/app-memidb-listener-removal

Conversation

@OskarEichler

Copy link
Copy Markdown
Contributor

What this fixes

Removing an IndexedDB fallback listener that was never registered no longer deletes the last real listener. The prior findIndex() result of -1 was passed directly to splice(-1, 1), silently suppressing a legitimate request or transaction callback.

Implementation

Only splice the listener array when a matching listener was found. Registered-listener removal behavior is unchanged.

Verification

The exact baseline regression registers two success listeners, removes an unrelated callback, and observes that the second real listener is never called. Both listeners run with this change. Complete repository gates pass:

  • yarn lerna:prepare
  • yarn tests:jest --runInBand — 104 suites, 1,480 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. This aligns the fallback EventTarget with standard no-op removal semantics.

@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

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.47%. Comparing base (81beeca) to head (cd1ef86).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #9270      +/-   ##
============================================
- Coverage     68.50%   68.47%   -0.03%     
  Complexity     1915     1915              
============================================
  Files           522      523       +1     
  Lines         38116    38136      +20     
  Branches       5189     5189              
============================================
+ Hits          26108    26110       +2     
- Misses        10222    10241      +19     
+ Partials       1786     1785       -1     
Flag Coverage Δ
android-native 63.76% <ø> (ø)
e2e-ts-android 54.00% <ø> (ø)
e2e-ts-ios 53.50% <ø> (ø)
e2e-ts-macos 49.67% <100.00%> (-0.01%) ⬇️
ios-native 68.79% <ø> (+0.01%) ⬆️
ios-ruby 100.00% <ø> (ø)
jest 46.37% <50.00%> (+0.10%) ⬆️

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 merged commit c8648a6 into invertase:main Sep 1, 2026
25 checks passed
@mikehardy mikehardy removed the Workflow: Pending Merge Waiting on CI or similar label Sep 1, 2026
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