New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Transaction.supportsFiltering check disappeared from InMemoryDataStoreTransaction.loadObject #2607
Comments
Transaction.supportsFiltering logic moved into DataStoreIterable: Transaction.loadObjects can return a custom implementation of this interface which can tell Elide whether or not the wrapped Iterable should be filtered in memory or be left alone. This was changed because the original interface lacked sufficient context for all data stores to tell Elide whether or not filtering, pagination, or sorting should be done in-memory on the server. The second issue you raise is whether InMemoryDataStoreTransaction could always call loadObject in the wrappedTransaction rather than delegate to DataStoreTransaction.loadObject. I generally agree something like this would make sense, but it might change the behavior and break other implementations. We might need to do an Elide 7 release to make that kind of change. |
Transaction.supportsFiltering
check disappeared fromInMemoryDataStoreTransaction.loadObject
after upgrade, and now whenfilterExpression
is notnull
,InMemoryDataStoreTransaction
never calls an overriddenDataStoreTransaction.loadObject
and instead relies on the originalDataStoreTransaction.loadObject
which performs an in-memory filtering on all available objects in a datastore, even when a per-object filtering capability is available. Is this an expected behavior?Expected Behavior
A way to make
InMemoryDataStoreTransaction
call a custom datastoreloadObject
even whenEntityProjection.filterExpression
is not null.Current Behavior
InMemoryDataStoreTransaction
ignores a custom datastoreloadObject
because offilterExpression
and instead callsDataStoreTransaction.loadObject
which performs filtering on all available objects in-memory.Possible Solution
Return the
tx.supportsFiltering == FeatureSupport.FULL
check back (commit). Or is there another work-around?Steps to Reproduce (for bugs)
NoopDataStore
andNoopDataStoreTransaction
withloadObject
,loadObjects
filterExpression
for the model (in our case it's a security check)loadObjects
is called, butloadObject
is ignoredContext
We have a datastore derived from
NoopDataStore
with both overriddenloadObject
andloadObjects
. OurloadObject
can efficiently get a single object usingSerializable id
(and handlefilterExpression
). During runtime, however, our overriddenDataStoreTransaction
seems be wrapped inInMemoryDataStoreTransaction
which never calls ourloadObject
becauseEntityProjection.filterExpression
is not null. We would like forInMemoryDataStoreTransaction
to call ourloadObject
instead of relying onDataStoreTransaction.loadObject
which calls ourloadObjects
and then performs in-memory filtering of all available objects in our datastore. Is something like this possible?Your Environment
The text was updated successfully, but these errors were encountered: