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

RangeError: Maximum call stack size exceeded #10

Closed
ltamrazov opened this issue Oct 15, 2020 · 1 comment
Closed

RangeError: Maximum call stack size exceeded #10

ltamrazov opened this issue Oct 15, 2020 · 1 comment

Comments

@ltamrazov
Copy link

Hi,

First of thank you for the work on this plugin! This error is a result of a unique combination of plugins, so could be an edge case, nevertheless here I go:

We use this plugin as well as with https://github.com/mlipscombe/postgraphile-plugin-fulltext-filter. The issue is that the fulltext-filter plugin modifies the args to replace the type on the tsvector columns with a deeply nested object (it contains tokenization information).

As a result, when we update a field of type tsvector (that is manipulated by that plugin) postgraphile-upload exceeds max stack when it dives into it: RangeError: Maximum call stack size exceeded. We feel this is a bug because in this case we are not even trying to upload a file, but the plugin is preventing an update on a different unrelated fields.

I'm not sure what the solution would be, we thought of two options:

  • Move on when recursion reaches a certain depth
  • Provide an option to black list certain fields in which case the plugin would not even dive into them to begin with

The object that is we are attempting to update is like:

{
    block:false,
    kind:'StringValue',
    // this is the key that causes max call stack, since both startToken and endToken are deeply nested,
    loc:Loc {start: 86, end: 107, startToken: Tok, endToken: Tok, source: Source},
    value:'abl:368 accommod:81',
}

Thank you!

@ltamrazov
Copy link
Author

Sorry, wrong repo. Closing in favor of:
graphile-contrib/postgraphile-plugin-upload-field#13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant