react-native-onyx icon indicating copy to clipboard operation
react-native-onyx copied to clipboard

`captureMetrics` doe not seem to be working anymore.

Open marcaaron opened this issue 2 years ago • 3 comments

Reproduction:

  • Add captureMetrics: true in Onyx.init()
  • Observe error in JS console
app-c63af0784ac898b80ef3.bundle.js:33823 Uncaught TypeError: getAllKeys is not a function
    at addAllSafeEvictionKeysToRecentlyAccessedList (web.development.js?d0e7:698:1)
    at Object.init (web.development.js?d0e7:1418:1)
    at __WEBPACK_DEFAULT_EXPORT__ (index.js?ce78:22:5)
    at eval (index.js?41f5:12:19)
    at ./index.js (app-c63af0784ac898b80ef3.bundle.js:7140:1)
    at __webpack_require__ (app-c63af0784ac898b80ef3.bundle.js:33820:33)
    at app-c63af0784ac898b80ef3.bundle.js:34910:37
    at app-c63af0784ac898b80ef3.bundle.js:34912:12

I think maybe the lazy import of this code just doesn't work because we are using a bundle that is already built, but not entirely sure

https://github.com/Expensify/react-native-onyx/blob/98260f1deacbcca1a687441164cd45d7d915afb8/lib/Onyx.js#L964

I think we can just include this in all dev bundles

marcaaron avatar Sep 21 '22 18:09 marcaaron

Here is the reported issue. https://github.com/Expensify/App/issues/10622

parasharrajat avatar Sep 21 '22 18:09 parasharrajat

This is the cause on Native https://github.com/Expensify/react-native-onyx/pull/133/files#r975658158.

On the web, the signatures of methods are wrong in metrics/index.web.js

parasharrajat avatar Sep 21 '22 18:09 parasharrajat

Ah nice one! Thanks @parasharrajat

marcaaron avatar Sep 21 '22 18:09 marcaaron