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

Plugin API + Access Rules : return more informative message #1018

Open
jperon opened this issue Jun 4, 2024 · 3 comments
Open

Plugin API + Access Rules : return more informative message #1018

jperon opened this issue Jun 4, 2024 · 3 comments

Comments

@jperon
Copy link

jperon commented Jun 4, 2024

I just had very hard time debugging an issue due to IMHO misleading error messages. I had put an access rule preventing modifications on a table depending of the value of one of its fields. When trying to add records via BulkAddRecords, despite having set a message with the rule, this message didn’t appear (neither bottom-right, nor in the console or on server logs). The only messages I got are shown below.

On the client:

Error: Cannot read properties of undefined (reading '0')

On the server:

grist_1      | 2024-06-04 16:00:08.555 - warn: Sharing Unable to apply action... TypeError: Cannot read properties of undefined (reading '0')
grist_1      |     at getActionUndoInfoWithoutClient (/grist/_build/app/server/lib/ActionHistory.js:93:37)
grist_1      |     at asActionGroup (/grist/_build/app/server/lib/ActionHistory.js:36:74)
grist_1      |     at Sharing._doApplyUserActions (/grist/_build/app/server/lib/Sharing.js:275:67)
grist_1      |     at async Sharing._applyLocalAction (/grist/_build/app/server/lib/Sharing.js:89:25)
grist_1      |     at async WorkCoordinator._tryNextStep (/grist/_build/app/server/lib/WorkCoordinator.js:45:21) access=owners, userId=6, [email protected], age=628, org=myawesomeorganization, clientId=3d70d978479ed860, counter=0, docId=7kHK1rpTHsestxGJwJoQ7R
grist_1      | 2024-06-04 16:00:08.555 - warn: Client Responding to method applyUserActions with error: TypeError: Cannot read properties of undefined (reading '0')
grist_1      |     at getActionUndoInfoWithoutClient (/grist/_build/app/server/lib/ActionHistory.js:93:37)
grist_1      |     at asActionGroup (/grist/_build/app/server/lib/ActionHistory.js:36:74)
grist_1      |     at Sharing._doApplyUserActions (/grist/_build/app/server/lib/Sharing.js:275:67)
grist_1      |     at async Sharing._applyLocalAction (/grist/_build/app/server/lib/Sharing.js:89:25)
grist_1      |     at async WorkCoordinator._tryNextStep (/grist/_build/app/server/lib/WorkCoordinator.js:45:21)  [email protected], userId=6, age=628, org=myawesomeorganization, clientId=3d70d978479ed860, counter=0
grist_1      | 2024-06-04 16:00:08.555 - warn: Client responding to #40 ERROR Cannot read properties of undefined (reading '0') [email protected], userId=6, age=628, org=myawesomeorganization, clientId=3d70d978479ed860, counter=0
@paulfitz
Copy link
Member

paulfitz commented Jun 5, 2024

Thanks for reporting this. That kind of error message smells like a bug. If it isn't too sensitive, would it be possible to get some screenshots, or a small doc replicating the essentials of your setup?

@jperon
Copy link
Author

jperon commented Jun 5, 2024

Sure. What would be more useful? Dockerfile, definitions of tables, anything else?

@paulfitz
Copy link
Member

paulfitz commented Jun 5, 2024

I'd be focused on steps needed to replicate the problem. So anything that narrows down the access rules to try, which in turn may need definition of tables. Also, when you are adding the records via BulkAddRecords, what is initiating that action, is it via API or on the web client, just so we can do the same thing.

It is a burden to prepare that, I know. From what you already reported, I could go to getActionUndoInfoWithoutClient and try to think of improvements to make. The problem would be to know if they have been effective.

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

2 participants