ssacl-attribute-roles icon indicating copy to clipboard operation
ssacl-attribute-roles copied to clipboard

Unhandled rejection RangeError: Maximum call stack size exceeded

Open eclipse1985 opened this issue 9 years ago • 6 comments

Hi,

I'm experiencing some problems using your library (version 0.0.5). I use it in order to define visibility scope in various sequelize entities, for example:

cache: {
            type: DataTypes.TEXT,
            roles: {
                self: true
            }
        }

Sometimes, after an undefined number of call (a lot), I can't realize when exactly, a get this error:

Unhandled rejection RangeError: Maximum call stack size exceeded
    at target.Instance.get (/var/app/current/node_modules/ssacl-attribute-roles/lib/index.js:52:23)
    at target.Instance.get (/var/app/current/node_modules/ssacl-attribute-roles/lib/index.js:52:23)
    at target.Instance.get (/var/app/current/node_modules/ssacl-attribute-roles/lib/index.js:52:23)
    at target.Instance.get (/var/app/current/node_modules/ssacl-attribute-roles/lib/index.js:52:23)
    at target.Instance.get (/var/app/current/node_modules/ssacl-attribute-roles/lib/index.js:52:23)
    at target.Instance.get (/var/app/current/node_modules/ssacl-attribute-roles/lib/index.js:52:23)
    at target.Instance.get (/var/app/current/node_modules/ssacl-attribute-roles/lib/index.js:52:23)
    at target.Instance.get (/var/app/current/node_modules/ssacl-attribute-roles/lib/index.js:52:23)
    at target.Instance.get (/var/app/current/node_modules/ssacl-attribute-roles/lib/index.js:52:23)
    at target.Instance.get (/var/app/current/node_modules/ssacl-attribute-roles/lib/index.js:52:23)
    at target.Instance.get (/var/app/current/node_modules/ssacl-attribute-roles/lib/index.js:52:23)
    at target.Instance.get (/var/app/current/node_modules/ssacl-attribute-roles/lib/index.js:52:23)
    at target.Instance.get (/var/app/current/node_modules/ssacl-attribute-roles/lib/index.js:52:23)
    at target.Instance.get (/var/app/current/node_modules/ssacl-attribute-roles/lib/index.js:52:23)
    at target.Instance.get (/var/app/current/node_modules/ssacl-attribute-roles/lib/index.js:52:23)
    at target.Instance.get (/var/app/current/node_modules/ssacl-attribute-roles/lib/index.js:52:23)

can you help me?

eclipse1985 avatar Jun 23 '15 15:06 eclipse1985

I'm afraid i haven't encountered this error before. Anyway you can show me some code that reproduces this to some kind of certainty?

mickhansen avatar Jun 24 '15 07:06 mickhansen

Hmm, are you calling ssaclAttributeRoles(sequelize|models) multiple times in your code over time? Looks like the code keeps calling itself whcih should only happen if the init code is called multiple times.

mickhansen avatar Jun 24 '15 07:06 mickhansen

Yes, I noticed that I call it twice, I tried to fix and now I'm testing

eclipse1985 avatar Jun 26 '15 08:06 eclipse1985

Must be calling it more than twice, you must be calling it continously. Would be great to implement a check for this.

mickhansen avatar Jun 26 '15 08:06 mickhansen

Ok, i fixed it.

eclipse1985 avatar Jun 30 '15 16:06 eclipse1985

I'm reopening to remind myself to throw an error if init'ed twice.

mickhansen avatar Jun 30 '15 17:06 mickhansen