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
First let me say β thanks for an amazing library! It's been really useful for our project π
I've tracked down an issue related to array usage within SyncedStore objects, which eventually results in stack overflow. Here's the shortest example I could create that demonstrates the issue:
import{syncedStore}from"@syncedstore/core";typeStoreRoot={foo: Foo;};typeFoo={bar?: number[];};conststore=syncedStore<StoreRoot>({foo: {}});constcount=100000;for(leti=0;i<count;++i){if(i%1000===0){console.log(`${i} of ${count}`);}// Results in patchGetter('length') being called on the array, even though it's already been patchedstore.foo.bar=[42];// Once the loop has executed enough times, reading the length will result in stack overflowstore.foo.bar.length;}
Output:
0 of 100000
1000 of 100000
2000 of 100000
3000 of 100000
4000 of 100000
5000 of 100000
6000 of 100000
@reactivedata/reactive:372
get: function get(target, key, receiver) {
^
RangeError: Maximum call stack size exceeded
at Object.get (@reactivedata/reactive:372:20)
at observable (@reactivedata/reactive:287:13)
at Atom.reportObserved (@reactivedata/reactive:561:12)
at reportSelfAtom (@syncedstore/yjs-reactive-bindings:111:14)
at YArray.descriptor.get (@syncedstore/yjs-reactive-bindings:185:9)
at YArray.descriptor.get (@syncedstore/yjs-reactive-bindings:188:25)
at YArray.descriptor.get (@syncedstore/yjs-reactive-bindings:188:25)
at YArray.descriptor.get (@syncedstore/yjs-reactive-bindings:188:25)
at YArray.descriptor.get (@syncedstore/yjs-reactive-bindings:188:25)
at YArray.descriptor.get (@syncedstore/yjs-reactive-bindings:188:25)
In our application we run into this quite regularly during any periods of extended usage. Please let me know if I can be of any further help!
The text was updated successfully, but these errors were encountered:
First let me say β thanks for an amazing library! It's been really useful for our project π
I've tracked down an issue related to array usage within SyncedStore objects, which eventually results in stack overflow. Here's the shortest example I could create that demonstrates the issue:
Output:
In our application we run into this quite regularly during any periods of extended usage. Please let me know if I can be of any further help!
The text was updated successfully, but these errors were encountered: