Then, select a record and click the “Custom Update” button. This will create a queue, where the 2nd request is an update with an operationId and a cacheSyncOperation. Both operationIds are different from the grid’s fetchOperation and the updateOperation. Nevertheless it seems that the framework is using the returned record to update the client cache.
Hi Claudio
Sorry for the delay on this one - it’s sparked some internal discussion and analysis.
The issue here is basically an inaccuracy in the ResultSet documentation. The documentation for ResultSet claims that cache synchronization in response to add or update operations will not occur when the ResultSet’s fetch operation doesn’t match the add/update’s “cacheSynchOperation”.
That’s inaccurate - the ResultSet will integrate changes into its cache even if its fetch doesn’t match up with the cacheSynchOperation for an add or update operation on the same DataSource.
We will be correcting the documentation, and our design team is considering whether/how to also add an attribute to enable strict cache enforcement support.
We will follow up on this thread with updates as they occur.
One question for you: Is this causing issues in your application design currently / do you have a workaround?
If this is causing you difficulty, please also let us know your use case so we can make sure it is fully considered as we improve this area.
I’m also quite sure that at some point over the years, I had to apply workarounds in my code to “bypass” this behaviour. So now, it seems to me that the behaviour has changed.
My first concern is that there might be parts of my applications that need to be reviewed, and at the moment, I wouldn’t know how to easily identify them.
Regarding my specific case: I have a grid whose DataSource has a custom update operation that modifies a field that is not visible in the grid. Its cacheSyncOperation is a query that retrieves a summary (which changes after the update), and this is the actual data that I need to visually update, however, the framework is trying to use the result to update the grid.
With the current behaviour, would I be forced to use a separate DataSource for this operation?
You’re correct - we had a rare flub in that thread, where documentation was added to describe existing behavior, but the existing behavior was not actually what we thought.
As far as the actual behavior, our analysis shows that it actually never changed - only the documentation changed.
We’re hoping that this means that you adjusted your code anticipating the framework behavior we described, rather than that the behavior actual changed. But please let us know if you’re seeing a behavior change.
Also, you mentioned that you were considering an attribute for strict cache enforcement. Is that still planned?
A use case where it matters for me: updateCaches() after a RealTimeMessaging push.
In the past I have always used RTM like the Portfolio Grid sample does: the message carries the changed values, the record is taken from the grid’s cache, updated, and passed to updateCaches().
But updateCaches() reaches every ResultSet on the DataSource, whatever its fetchOperation. If another grid on the same DataSource fetches more fields, those fields are cleared.
A grid that fetches fewer fields gets fields it never asked for.
Pushing the complete record from the server doesn’t avoid this, since different components can use different sets of fields of the same DataSource.
Is there a recommended way to apply a pushed change safely in this case? Is a “strict cache enforcement” attribute a possible solution for this?
As a potentially overlapping or orthogonal flag, it seems like you need updateCaches() - or perhaps cache sync in general - to be scoped to either a particular fetch operationId, or even to specific component. At the extreme here, would you want eg DBC.updateCaches()?
Specific details on the scenarios that require new settings would be great!
I have a custom server DataSource (an SQLDataSource subclass) that stores files in blob storage.
When a video is uploaded, an external converter produces an HLS version and then calls a REST callback, which saves the HLS URL (along with some status fields) on the record.
I then use RealTimeMessaging to push those values, so that grids and forms can be updated.
So, after some more thought, what I would actually need seems a “partial” flag as you’re hypothesizing.
A partial updateCaches() (with the PK and the changed fields) could merge the values into every cache (ResultSets and forms), leaving the other fields untouched.
Two details would matter:
a partial record for a row that isn’t present in a cache should be ignored, rather than added
a field explicitly set to null should be cleared, while an absent field should be left as is
“full” replaces ResultSet records, nulls and missing fields are cleared, record added if in the filter. In Forms, no RS, doesn’t add new records (no pk match), and clears null fields but not missing ones. If you want that behavior, you can set DF.cacheSyncClearsOmittedFields.
“partial” merges into an existing ResultSet record, nulls are cleared but missing fields are not. In Forms, no RS, merge only.
In all cases, local edits in forms are retained - if the incoming value differs, it’s still a local change; if the values match, it’s no longer considered a local change.
I think that I bought up the very same topic of ResultSet cacheSync in 2022 here. Also it seems that the ResultSet docs are still unchanged using v14.1p_2026-10-09 (in #4 you said you will be correcting the documentation):
Thank you very much for backporting cacheSyncData “partial” to v13.1p_2026-10-21: we are moving our Real-Time Messaging pushes to it.
The docs for DynamicForm.cacheSync still say:
ValuesManager.cacheSync has the same paragraph. Should these two paragraphs be updated, now that DataSource.updateCaches recommends cacheSyncData “partial” for this kind of push?
hi Claudio - we’ve fixed those docs and added some linking between the cache-sync overview, which talked about the server only, and these new features.