Comments (7)
I looked at what changed between dev.25
and dev.37
and think that this is the cause - iTwin/imodel-native#550. Most likely we're now able to find the cached provider with old data and don't attempt to re-load it. I'll try to reproduce this locally to confirm.
In the meantime, can you try to set the { caching: { content: { size: 0 } } }
when initializing Presentation
on the backend and see if that helps?
from viewer-components-react.
While it looks like iTwin/imodel-native#550 is what caused this to stop working, I don't think there's anything wrong with the change as it just makes sure we actually use our cache rather than re-create content on each request.
I confirmed we are correctly tracking element changes in the iModel and clearing affected cache entries as necessary. Added a test to prove that it works: iTwin/itwinjs-core@master...presentation/content-after-imodel-changes. @Rock2000, can you have a look at the test and your set up and see if there're any differences?
A few notes:
updatesPollInterval
is required when callingPresentation.initialize
on the backend for changes to be tracked.- You'll notice some hacks in my test related to IPC and Txns - those should not be necessary in a real set up.
from viewer-components-react.
The { caching: { content: { size: 0 } } } options seems to 'fix' it, if that helps any. Let me try to look at the test
from viewer-components-react.
Setting updatesPollInterval:1 also seemed to fix it. Is that the correct fix? Does it make sense that things seemed to work previously without this flag? Also I'm not sure how to pick a good value. What is occurring during this interval? Is it polling the backend from the frontend?
from viewer-components-react.
Setting updatesPollInterval:1 also seemed to fix it. Is that the correct fix?
Yes, setting updatesPollInterval
is the correct fix. I figure neither name nor the docs of this attribute are perfect - I filed an issue for improving that.
Does it make sense that things seemed to work previously without this flag?
Setting the attribute does two things (both on the backend):
- Registers iModel data changes listener that clears affected entries from various caches and creates "update records" describing what changed.
- In our TS backend part, polls the "update records" from addon at the specified interval and streams them to the frontend for components to know what to update.
In dev.25
there was a bug that caused us to always miss cached content entries, so you always got fresh content even without clearing the cache entries. With that bug fixed, performing the step 1 above became important.
Without this attribute, even in dev.25
, I would assume the property grid didn't auto-reload when you changed a value, did it?
Also I'm not sure how to pick a good value. What is occurring during this interval? Is it polling the backend from the frontend?
See above for what it's polling. Polling happens on the main backend's thread, so I would avoid setting this to something smaller than 5 ms. On the other hand, setting a large poll interval will make components "lag" to update, so it probably shouldn't be larger than 20 ms or similar.
from viewer-components-react.
Yeah the property grid did refresh automatically in 25 and even earlier. We've had the property grid added for a couple months, and although we don't use it much yet it has seemed to work up until 37.
But I'll add the polling value as that does fix it. Thanks
from viewer-components-react.
Closing this issue as it's now resolved and further improvements will be tracked by iTwin/itwinjs-core#6338.
from viewer-components-react.
Related Issues (20)
- Tree widget: Categories tree search returns too many results in some cases HOT 1
- Tree widget: Tree load takes too much time when a lot of elements are selected with instance focus mode enabled HOT 2
- Tree widget: Parent node visibility doesn't change to "on" when all children are turned on
- Tree widget: Filtering dialog date picker shows up below the dialog in z-index HOT 1
- Tree widget: Visibility of parent nodes isn't updated when children' visibility is changed quickly HOT 1
- Tree widget: Node should be auto-expanded when a filter is applied to it
- Tree widget: Checkbox does not have outline when focused with TAB
- Tree widget: No way to access filtering with keyboard
- Tree widget: Tree stops working after applying filter HOT 1
- Tree widget: IModel content tree shows nodes as having children, but they don't
- Tree widget: Models tree shows nodes that it shouldn't
- PropertyGrid shows an error when selecting a 2D element of a sheet view HOT 3
- Tree widget: Duplicated properties in hierarchy level filtering dialog HOT 1
- Tree widget: Grouping nodes should not auto-expand when being focused
- Tree widget: Clean up old components and promote stateless ones
- Tree widget: Models tree root node should have no expander
- Tree widget: Expose visibility tree building blocks
- Tree widget: Scroll position is not persisted when switching between widgets
- Property widget: Need informational message when all properties are filtered out
- Tree widget: Make use of the new `onlyIfNotHandled` flag in hierarchy definitions
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from viewer-components-react.