question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fails when adding items with long arrays in filter fields

See original GitHub issue
/Users/eklem/git_modules/search-index-indexer/node_modules/search-index/node_modules/levelup/node_modules/level-codec/index.js:34
  return this._valueEncoding(opts, batchOpts).encode(value);
                                              ^

RangeError: Invalid string length
    at Object.stringify [as encode] (native)
    at Codec.encodeValue (/Users/eklem/git_modules/search-index-indexer/node_modules/search-index/node_modules/levelup/node_modules/level-codec/index.js:34:47)
    at /Users/eklem/git_modules/search-index-indexer/node_modules/search-index/node_modules/levelup/node_modules/level-codec/index.js:56:23
    at Array.map (native)
    at Codec.encodeBatch (/Users/eklem/git_modules/search-index-indexer/node_modules/search-index/node_modules/levelup/node_modules/level-codec/index.js:48:14)
    at LevelUP.batch (/Users/eklem/git_modules/search-index-indexer/node_modules/search-index/node_modules/levelup/lib/levelup.js:307:26)
    at /Users/eklem/git_modules/search-index-indexer/node_modules/search-index/node_modules/search-index-adder/index.js:228:30
    at /Users/eklem/git_modules/search-index-indexer/node_modules/search-index/node_modules/async/lib/async.js:52:16
    at /Users/eklem/git_modules/search-index-indexer/node_modules/search-index/node_modules/async/lib/async.js:269:32
    at /Users/eklem/git_modules/search-index-indexer/node_modules/search-index/node_modules/async/lib/async.js:44:16

To reproduce:

$ npm install search-index-searcher

and then:

$ node --max-old-space-size=12288 index.js -c https://raw.githubusercontent.com/eklem/recipes-klikk-dataset/master/config.json -d https://raw.githubusercontent.com/eklem/recipes-klikk-dataset/master/klikk-recipes.json -s 5054 -e 5054

Should maybe cut off too long arrays. That would be the best I think. Second best would be to fail gracefully and give a meaningful error message.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
eklemcommented, Sep 16, 2016

Nice! I’ll assemble some content and re-test when 0.9 is on NPM. And you can add it to the automated tests.

0reactions
fergiemcdowallcommented, Sep 16, 2016

I’m just having a tidy up, and I’m pretty sure that this is fixed- so I’ll close this just now, reopen if it is still a problem with 0.9.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

Filter Array Action Fails After Adding OData Sort to Get Items
Solved: I have built a workflow which gets items from a list, filters for items with an "Internal Date" field greater than 7...
Read more >
Logstash in check for array only works with more than 1 element
When there is only one element, logstash reads a field name, so the check in ["a"] looks for a field named "a" and...
Read more >
VBA ArrayList - A Complete Guide - Excel Macro Mastery
Quick Guide to the VBA ArrayList ; Access all items(For), Item, index - long integer ; Add item, Add, object or value ;...
Read more >
Filter an array or collection in Power Automate - SharePains
I need to compare two arrays that are similar but not column by column the same (one has more columns than the other);...
Read more >
Excel FILTER Function Examples - Lists Update Automatically
City names are in A-Z order, but the sales rep names are not sorted. 2 columns in array argument. Add SORT Function Optional...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found