ssacl-attribute-roles
ssacl-attribute-roles copied to clipboard
Unhandled rejection RangeError: Maximum call stack size exceeded
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?
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?
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.
Yes, I noticed that I call it twice, I tried to fix and now I'm testing
Must be calling it more than twice, you must be calling it continously. Would be great to implement a check for this.
Ok, i fixed it.
I'm reopening to remind myself to throw an error if init'ed twice.