You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Browse filesBrowse the repository at this point in the historyBrowse files
authored and
Eliran Eretz-Kedosha
committed
Hide scoped-index put behind putInIndexAfterGet_DoNotUse + IScopedIndexPutProvider
Address Jeremie's PR review comment about the scoped-index put() overload
being reachable via a direct cast on the public InMemoryProvider class,
which made it too easy for consumers to accidentally break the
all-indexes-stay-in-sync invariant.
- Renamed InMemoryProvider's scoped put overload to
putInIndexAfterGet_DoNotUse(storeName, itemOrItems, indexNames), with
indexNames now required (not optional) since scoping is the entire
point of this method.
- Added an exported IScopedIndexPutProvider interface and an
asScopedIndexPutProvider(provider) type-guard/cast helper as the only
sanctioned way to discover/reach this capability -- InMemoryProvider
does not declare 'implements IScopedIndexPutProvider', so it doesn't
show up on the class surface itself.
- Split InMemoryStore's internal put implementation into a plain put()
(interface-compliant with DbStore, always populates every index),
putInIndexAfterGet_DoNotUse() (scoped), and a shared private
_putInternal() so both call sites reuse the same logic.
- Updated the _getStoreTransaction() comment and the scoped-put test to
use the new name/helper instead of an InMemoryProvider cast.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 009bd0a8-f98f-4048-a261-e0a627813a00
0 commit comments