Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Uncaught TypeError: s.pins.push is not a function" when using imported query #2488

Closed
philrz opened this issue Aug 16, 2022 · 2 comments · Fixed by #2472
Closed

"Uncaught TypeError: s.pins.push is not a function" when using imported query #2488

philrz opened this issue Aug 16, 2022 · 2 comments · Fixed by #2472
Labels
bug Something isn't working

Comments

@philrz
Copy link
Contributor

philrz commented Aug 16, 2022

Repro is with Brim commit 1ee21a8.

Steps as shown in the attached video:

  1. Import the Brim.json that represents the exported query folder from GA Brim tagged v0.31.0.
  2. Import a pcap, such as the sample.pcap from this repo.
  3. Click Query Pool
  4. Click the Unique DNS Queries from the library
  5. Observe the "pool name is missing" error, which is expected since queries in the old app experienced lacked these (see Dynamic pins for saved queries #2478)
  6. Attempt to click Pins > New 'From' Pin in an attempt to correct this

As the repro shows, rather than adding the pin, nothing happens.

Repro.mp4

Here's the error dump that appears in DevTools at that point:

/Users/phil/work/brim/dist/js/state/Editor/reducer.js:43 Uncaught TypeError: s.pins.push is not a function
    at addPin (/Users/phil/work/brim/dist/js/state/Editor/reducer.js:43)
    at createReducer.ts:247
    at Immer.produce (immerClass.ts:96)
    at createReducer.ts:246
    at Array.reduce (<anonymous>)
    at createReducer.ts:213
    at Object.combination [as default] (/Users/phil/work/brim/node_modules/redux/lib/redux.js:465)
    at /Users/phil/work/brim/dist/js/state/Tabs/reducer.js:100
    at createReducer.ts:247
    at Immer.produce (immerClass.ts:96)

Not sure if it's related, but before that dump, there also were several dumps of the form:

pool name missing 
    at ResultsError (/Users/phil/work/brim/dist/app/query-home/results/results-error.js:28:28)
    at div
    at I (/Users/phil/work/brim/node_modules/styled-components/dist/styled-components.cjs.js:1:19375)
    at AppErrorBoundary (/Users/phil/work/brim/dist/js/components/AppErrorBoundary.js:34:9)
    at div
    at I (/Users/phil/work/brim/node_modules/styled-components/dist/styled-components.cjs.js:1:19375)
    at ResultsComponent (/Users/phil/work/brim/dist/app/query-home/results/index.js:56:33)
    at div
    at I (/Users/phil/work/brim/node_modules/styled-components/dist/styled-components.cjs.js:1:19375)
    at div
    at I (/Users/phil/work/brim/node_modules/styled-components/dist/styled-components.cjs.js:1:19375)
    at QueryHome (/Users/phil/work/brim/dist/app/query-home/index.js:37:36)
    at QueryRoute (/Users/phil/work/brim/dist/app/query-home/route.js:40:39)
    at Route (/Users/phil/work/brim/node_modules/react-router/cjs/react-router.js:464:29)
    at Switch (/Users/phil/work/brim/node_modules/react-router/cjs/react-router.js:666:29)
    at InitLake (/Users/phil/work/brim/dist/app/lakes/root.js:72:21)
    at LakeRoot (/Users/phil/work/brim/dist/app/lakes/root.js:24:37)
    at main
    at I (/Users/phil/work/brim/node_modules/styled-components/dist/styled-components.cjs.js:1:19375)
    at MainArea (/Users/phil/work/brim/dist/app/routes/app-wrapper/main-area.js:33:21)
    at div
    at I (/Users/phil/work/brim/node_modules/styled-components/dist/styled-components.cjs.js:1:19375)
    at AppGrid (/Users/phil/work/brim/dist/app/routes/app-wrapper/app-grid.js:26:20)
    at AppWrapper (/Users/phil/work/brim/dist/app/routes/app-wrapper/app-wrapper.js:14:23)
    at Route (/Users/phil/work/brim/node_modules/react-router/cjs/react-router.js:464:29)
    at Switch (/Users/phil/work/brim/node_modules/react-router/cjs/react-router.js:666:29)
    at TabsRouter (/Users/phil/work/brim/dist/app/router/tabs-router.js:61:9)
    at AppTabsRouter (/Users/phil/work/brim/dist/app/router/app-tabs-router.js:11:26)
    at App (/Users/phil/work/brim/dist/js/components/App.js:21:33)
    at exports.ThemeProvider (/Users/phil/work/brim/node_modules/styled-components/dist/styled-components.cjs.js:1:25072)
    at Provider (/Users/phil/work/brim/node_modules/react-redux/lib/components/Provider.js:19:3)
    at DndProvider (/Users/phil/work/brim/node_modules/react-dnd/dist/cjs/core/DndProvider.js:41:23)
    at AppErrorBoundary (/Users/phil/work/brim/dist/js/components/AppErrorBoundary.js:34:9)
    at BrimProvider (/Users/phil/work/brim/dist/app/core/context.js:47:17)
@philrz philrz added the bug Something isn't working label Aug 16, 2022
@jameskerr
Copy link
Member

Aww shoot. Thanks @philrz

@philrz
Copy link
Contributor Author

philrz commented Sep 1, 2022

Verified in Brim commit b08ceaf.

As shown in the attached video, now we're able to successfully click Pins > New 'From' Pin to reference the pool and make the query return results.

Verify.mp4

Thanks @jameskerr!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants