NullVoxPopuli / ember-deep-tracked

Deep auto-tracking for when you just don't care, and want things to work (at the cost of performance in some situtations)
MIT License
30 stars 5 forks source link

Breaks when used with `array.includes` #339

Closed amk221 closed 1 month ago

amk221 commented 1 year ago

Demo repo:

https://github.com/amk221/-ember-deep-tracked-include-issue/commit/b31a0870ef65cf707903104e9e98aac2f665bacc

Error output:

Uncaught TypeError: Cannot use 'in' operator to search for 'Symbol(TARGET)' in 2
    at unwrap (index.js:14:1060)
    at Array.map (<anonymous>)
    at Proxy.fn (index.js:11:474)
    at get hasFoo2 [as hasFoo2] (application.js:22:1)
    at getPossibleMandatoryProxyValue (index.js:1699:1)
    at _getProp (index.js:1723:1)
    at reference.js:175:1
    at reference.js:136:1
    at track (validator.js:635:1)
    at valueForRef (reference.js:135:1)
unwrap @ index.js:14
fn @ index.js:11
get hasFoo2 @ application.js:22
getPossibleMandatoryProxyValue @ index.js:1699
_getProp @ index.js:1723
(anonymous) @ reference.js:175
(anonymous) @ reference.js:136
track @ validator.js:635
valueForRef @ reference.js:135
(anonymous) @ runtime.js:3269
evaluate @ runtime.js:1052
evaluateSyscall @ runtime.js:4214
evaluateInner @ runtime.js:4185
evaluateOuter @ runtime.js:4178
next @ runtime.js:5009
_execute @ runtime.js:4996
execute @ runtime.js:4971
(anonymous) @ runtime.js:5054
runInTrackingTransaction @ validator.js:138
sync @ runtime.js:5054
(anonymous) @ index.js:4726
(anonymous) @ index.js:4695
(anonymous) @ index.js:4988
inTransaction @ runtime.js:4090
_renderRoots @ index.js:4970
_renderRootsTransaction @ index.js:5014
_renderRoot @ index.js:4959
_appendDefinition @ index.js:4884
appendOutletView @ index.js:4874
invoke @ backburner.js:284
flush @ backburner.js:197
flush @ backburner.js:360
_end @ backburner.js:801
end @ backburner.js:592
_run @ backburner.js:845
run @ backburner.js:627
run @ index.js:74
callback @ index.js:355
NullVoxPopuli commented 1 year ago

Thanks for the reproduction!

NullVoxPopuli commented 1 month ago

Issue reproduced in the test suite: https://github.com/NullVoxPopuli/ember-deep-tracked/actions/runs/10713487671/job/29705582430?pr=357

NullVoxPopuli commented 1 month ago

Sorry it took so long! I forgot about this. Will be fixed in the next release