re-frame

pooriaTaj 2023-07-30T07:10:05.329279Z

Hi I am getting this exception from cljs-ajax library upon parsing a json response

:status-text "No protocol method IMapEntry.-key defined for type object: [object Object]  Format should have been JSON keywordize"

pooriaTaj 2023-07-30T07:10:35.706479Z

The data

"{\"IRT1FASA0001\":{\"pseudo-orders\":[{\"other-side-best-price\":14850,\"no-self-trade?\":true,\"in-range?\":true,\"sane-price?\":true,\"same-side-best-price\":14870,\"low-allowed-price\":13820,\"high-allowed-price\":16880,\"isin\":\"IRT1FASA0001\",\"sane-value?\":true,\"no-accidental-maker?\":true,\"side\":\"sell\",\"valid-portfo?\":true,\"send?\":true,\"quantity\":10000,\"price\":14860,\"v-limit\":5500000.0,\"same-side-order-quantity\":10000,\"sane-quantity?\":true,\"range?\":false,\"same-side-order-price\":15140}],\"symbol-info\":{\"m-windows\":{\"sell\":[{\"price\":14870,\"number\":4,\"quantity\":2360084,\"source\":\"tse\",\"side\":\"sell\",\"isin\":\"IRT1FASA0001\"}],\"buy\":[{\"price\":14850,\"number\":1,\"quantity\":493000,\"source\":\"tse\",\"side\":\"buy\",\"isin\":\"IRT1FASA0001\"}]},\"sm-windows\":{\"buy-s-window-sum\":500000,\"sell-s-window-sum\":100000,\"sell-maker-activated?\":true,\"no-sell?\":false,\"sell\":[{\"price\":15000,\"number\":1,\"quantity\":100000,\"source\":\"tse\",\"side\":\"sell\",\"isin\":\"IRT1FASA0001\"}],\"buy-taker-enabled?\":false,\"buy\":[{\"price\":14850,\"number\":1,\"quantity\":500000,\"source\":\"tse\",\"side\":\"buy\",\"isin\":\"IRT1FASA0001\"}],\"sell-m-trades-sum\":0,\"sell-taker-enabled?\":true,\"cancel-all?\":false,\"buy-maker-activated?\":false,\"buy-range-activated?\":false,\"sell-range-activated?\":false,\"no-buy?\":true,\"buy-m-trades-sum\":7000},\"n-m-s\":{\"sell\":{\"l\":20000.0,\"h\":100000.0},\"buy\":{\"l\":20000.0,\"h\":100000.0}},\"execution-map\":{\"sell-executed\":0,\"buy-executed\":18196.0,\"current-net-buy\":18196.0,\"max-net-buy\":30000.0}}},\"IRT3SATF0001\":{\"pseudo-orders\":[],\"symbol-info\":{\"m-windows\":{},\"sm-windows\":{},\"n-m-s\":{}}},\"IRT3SAEF0001\":{\"pseudo-orders\":[{\"other-side-best-price\":18610,\"no-self-trade?\":true,\"in-range?\":true,\"sane-price?\":true,\"same-side-best-price\":18710,\"low-allowed-price\":17433,\"high-allowed-price\":21307,\"isin\":\"IRT3SAEF0001\",\"sane-value?\":true,\"no-accidental-maker?\":true,\"side\":\"sell\",\"valid-portfo?\":true,\"send?\":true,\"quantity\":10000,\"price\":18940,\"v-limit\":5500000.0,\"same-side-order-quantity\":10000,\"sane-quantity?\":true,\"range?\":false,\"same-side-order-price\":18940}],\"symbol-info\":{\"m-windows\":{\"sell\":[{\"price\":18950,\"number\":1,\"quantity\":200000,\"source\":\"tse\",\"side\":\"sell\",\"isin\":\"IRT3SAEF0001\"}],\"buy\":[{\"price\":18600,\"number\":1,\"quantity\":200000,\"source\":\"tse\",\"side\":\"buy\",\"isin\":\"IRT3SAEF0001\"}]},\"sm-windows\":{\"buy-s-window-sum\":200000,\"sell-s-window-sum\":200000,\"sell-maker-activated?\":true,\"no-sell?\":false,\"sell\":[{\"price\":18950,\"number\":1,\"quantity\":200000,\"source\":\"tse\",\"side\":\"sell\",\"isin\":\"IRT3SAEF0001\"}],\"buy-taker-enabled?\":false,\"buy\":[{\"price\":18600,\"number\":1,\"quantity\":200000,\"source\":\"tse\",\"side\":\"buy\",\"isin\":\"IRT3SAEF0001\"}],\"sell-m-trades-sum\":0,\"sell-taker-enabled?\":true,\"cancel-all?\":false,\"buy-maker-activated?\":false,\"buy-range-activated?\":false,\"sell-range-activated?\":false,\"no-buy?\":true,\"buy-m-trades-sum\":0},\"n-m-s\":{\"sell\":{\"l\":20000.0,\"h\":100000.0},\"buy\":{\"l\":20000.0,\"h\":100000.0}},\"execution-map\":{\"sell-executed\":0,\"buy-executed\":10000.0,\"current-net-buy\":10000.0,\"max-net-buy\":30000.0}}},\"IRT3VISF0001\":{\"pseudo-orders\":[{\"other-side-best-price\":16758,\"no-self-trade?\":true,\"in-range?\":true,\"sane-price?\":true,\"same-side-best-price\":17094,\"low-allowed-price\":15520,\"high-allowed-price\":18968,\"isin\":\"IRT3VISF0001\",\"sane-value?\":false,\"no-accidental-maker?\":true,\"side\":\"sell\",\"valid-portfo?\":true,\"send?\":false,\"quantity\":0,\"price\":17095,\"v-limit\":5500000.0,\"same-side-order-quantity\":null,\"sane-quantity?\":false,\"range?\":false,\"same-side-order-price\":null}],\"symbol-info\":{\"m-windows\":{\"sell\":[{\"price\":17096,\"number\":1,\"quantity\":50000,\"source\":\"tse\",\"side\":\"sell\",\"isin\":\"IRT3VISF0001\"},{\"price\":17097,\"number\":1,\"quantity\":100000,\"source\":\"tse\",\"side\":\"sell\",\"isin\":\"IRT3VISF0001\"}],\"buy\":[{\"price\":16758,\"number\":2,\"quantity\":501000,\"source\":\"tse\",\"side\":\"buy\",\"isin\":\"IRT3VISF0001\"},{\"price\":16757,\"number\":1,\"quantity\":1100000,\"source\":\"tse\",\"side\":\"buy\",\"isin\":\"IRT3VISF0001\"}]},\"sm-windows\":{\"buy-s-window-sum\":1600000,\"sell-s-window-sum\":150000,\"sell-maker-activated?\":true,\"no-sell?\":false,\"sell\":[{\"price\":17095,\"number\":1,\"quantity\":50000,\"source\":\"tse\",\"side\":\"sell\",\"isin\":\"IRT3VISF0001\"},{\"price\":17096,\"number\":1,\"quantity\":100000,\"source\":\"tse\",\"side\":\"sell\",\"isin\":\"IRT3VISF0001\"}],\"buy-taker-enabled?\":false,\"buy\":[{\"price\":16757,\"number\":1,\"quantity\":500000,\"source\":\"tse\",\"side\":\"buy\",\"isin\":\"IRT3VISF0001\"},{\"price\":16756,\"number\":1,\"quantity\":1100000,\"source\":\"tse\",\"side\":\"buy\",\"isin\":\"IRT3VISF0001\"}],\"sell-m-trades-sum\":0,\"sell-taker-enabled?\":true,\"cancel-all?\":false,\"buy-maker-activated?\":false,\"buy-range-activated?\":false,\"sell-range-activated?\":false,\"no-buy?\":true,\"buy-m-trades-sum\":0},\"n-m-s\":{\"sell\":{\"l\":20000.0,\"h\":100000.0},\"buy\":{\"l\":20000.0,\"h\":100000.0}},\"execution-map\":{\"sell-executed\":0,\"buy-executed\":0.0,\"current-net-buy\":0.0,\"max-net-buy\":30000.0}}},\"IRT3KNIF0001\":{\"pseudo-orders\":[{\"other-side-best-price\":15100,\"no-self-trade?\":true,\"in-range?\":true,\"sane-price?\":true,\"same-side-best-price\":15145,\"low-allowed-price\":13870,\"high-allowed-price\":16952,\"isin\":\"IRT3KNIF0001\",\"sane-value?\":false,\"no-accidental-maker?\":true,\"side\":\"sell\",\"valid-portfo?\":true,\"send?\":false,\"quantity\":0,\"price\":15085,\"v-limit\":5500000.0,\"same-side-order-quantity\":null,\"sane-quantity?\":false,\"range?\":true,\"same-side-order-price\":null}],\"symbol-info\":{\"m-windows\":{\"sell\":[{\"price\":15199,\"number\":1,\"quantity\":169299,\"source\":\"tse\",\"side\":\"sell\",\"isin\":\"IRT3KNIF0001\"}],\"buy\":[{\"price\":15100,\"number\":1,\"quantity\":476877,\"source\":\"tse\",\"side\":\"buy\",\"isin\":\"IRT3KNIF0001\"}]},\"sm-windows\":{\"buy-s-window-sum\":530000,\"sell-s-window-sum\":169299,\"sell-maker-activated?\":true,\"no-sell?\":false,\"sell\":[{\"price\":15199,\"number\":1,\"quantity\":169299,\"source\":\"tse\",\"side\":\"sell\",\"isin\":\"IRT3KNIF0001\"}],\"buy-taker-enabled?\":false,\"buy\":[{\"price\":15101,\"number\":1,\"quantity\":30000,\"source\":\"tse\",\"side\":\"buy\",\"isin\":\"IRT3KNIF0001\"},{\"price\":15100,\"number\":1,\"quantity\":500000,\"source\":\"tse\",\"side\":\"buy\",\"isin\":\"IRT3KNIF0001\"}],\"sell-m-trades-sum\":0,\"sell-taker-enabled?\":true,\"cancel-all?\":false,\"buy-maker-activated?\":false,\"buy-range-activated?\":false,\"sell-range-activated?\":true,\"no-buy?\":true,\"buy-m-trades-sum\":345893},\"n-m-s\":{\"sell\":{\"l\":20000.0,\"h\":100000.0},\"buy\":{\"l\":20000.0,\"h\":100000.0}},\"execution-map\":{\"sell-executed\":0,\"buy-executed\":0.0,\"current-net-buy\":0.0,\"max-net-buy\":30000.0}}}}" 

pooriaTaj 2023-07-30T07:14:41.862239Z

The data seems to be okay it is even parsable with cheshire.core/parse-string from the chesire clojure library, so I don't really know what this exception is about

p-himik 2023-07-30T07:17:32.199199Z

As I mentioned under your original message, there's just not enough data to help you here. You should debug the exception on your end, in your browser. E.g. you can load the page (assuming a plain page load doesn't trigger the exception) create a breakpoint that's triggered on each thrown and caught exception (browsers let you do that), and trigger that request. You'll see exactly what calls (key ...) (cljs-ajax doesn't call it itself) and what that [object Object] actually is.