Code Too Large in RoleAndPrivileges setup


Type: SpringBot
Bot Version:


I just added two new user role and I cannot run serverside due to this error:

Attempted Resolutions

For now I split the code to several method, following the number of role. But since I worked on the outside of protected region my changes will be removed once I build codebots.
fix role

Hi @Dewi_Rosalin,

Thanks for getting in touch. Well done in getting to the bottom of this issue. After investigating, it looks like your model has reached another limit of SpringBot.

This issue is similar to the one that was resolved in SpringBot Release

As such, your solution is the preferred one. I have passed this onto the team to address.

Hi @kellie ,

Have you got any update about this issue? Since this issue is already disturbed our development right now.

Hi @Dewi_Rosalin ,

This issue will be worked on shortly. To help us provide this fix as fast as possible, can you please tell me what version of SpringBot you are currently on?

Once we know this, we can release a patch to this version that will just include this fix.

Hi @kellie ,

Currently we are using SpringBot

1 Like

Hi @Dewi_Rosalin,

Thanks for that information. This issue is being looked at now.

Hi @Dewi_Rosalin ,

Version is currently in the process of being released. This version will add a protected region that wraps the content of the setup method, thus allowing you to override the default behaviour. I will update you once this version is available for you to upgrade to.

Hi @kellie ,

But if you put the protected region there and I turn it on, then I will not get any changes when I add new entity or new role right?

Hi @Dewi_Rosalin , that is correct.

A more comprehensive solution would be ideal, however, this change would be potentially destructive if any of the existing protected regions are in use anywhere.

As such, it would need to be released as a new minor or major increment, which the current versioning policy does not support for older versions (the most recent version is SpringBot Release

The expected workflow as I see it would be to deactivate the protected region with the ID Override the setup here in each time the security model is changed, copy the changes into your methods in the protected region with ID Add any additional class methods here before deactivating it again.

Hi @Dewi_Rosalin,

I agree that the workflow is not ideal. After some internal deliberation, we have decided to release a fix that should not require any custom code to fix. This will take longer to implement and will be part of a subsequent release.

The fix mentioned in will hopefully enable you to continue for now while you wait for the more complete solution.

Hi @Dewi_Rosalin,

Good news! Version has been released and is now available for you to upgrade to it.

This release will add a protected region to allow you to make your changes without risking them being removed by the bot.

Hi @kellie ,

Glad to hear that. I will check it right now.
Thank you