When trying to open custom action (smart action) panel I get an error in console

I am trying to open custom action panel vua my main collection and it looks “stuck” (see screenshot)
on my console I get an error like the one detailed below


The full log file is in the sction below.

Expected behavior

Smart action will open the dialog and I could comlete my action

Actual behavior

Getting dialog with mask and “loading” icon on top of it

Failure Logs

VM1987:1 Uncaught (in promise) SyntaxError: Unexpected end of JSON input
at client-9b76b37d041acebbca8217ffa4663e18.js:19913
at tryCatch (r76hz8n6cnyn.js:1)
at Generator.invoke [as _invoke] (r76hz8n6cnyn.js:1)
at Generator.e. [as next] (r76hz8n6cnyn.js:1)
at a (client-9b76b37d041acebbca8217ffa4663e18.js:19897)
at l (client-9b76b37d041acebbca8217ffa4663e18.js:19899)
(anonymous) @ client-9b76b37d041acebbca8217ffa4663e18.js:19913
tryCatch @ r76hz8n6cnyn.js:1
invoke @ r76hz8n6cnyn.js:1
e. @ r76hz8n6cnyn.js:1
a @ client-9b76b37d041acebbca8217ffa4663e18.js:19897
l @ client-9b76b37d041acebbca8217ffa4663e18.js:19899
Promise.then (async)
T @ client-9b76b37d041acebbca8217ffa4663e18.js:19123
a @ client-9b76b37d041acebbca8217ffa4663e18.js:19125
(anonymous) @ client-9b76b37d041acebbca8217ffa4663e18.js:19125
(anonymous) @ client-9b76b37d041acebbca8217ffa4663e18.js:19124
(anonymous) @ client-9b76b37d041acebbca8217ffa4663e18.js:19156
value @ client-9b76b37d041acebbca8217ffa4663e18.js:19143
triggerCustomAction @ client-9b76b37d041acebbca8217ffa4663e18.js:1544
M @ vendor-775720e92b3b47b02b0a369dd547ba71.js:3143
c.triggerEvent @ vendor-775720e92b3b47b02b0a369dd547ba71.js:3073
n.trigger @ vendor-775720e92b3b47b02b0a369dd547ba71.js:5740
s.send @ vendor-775720e92b3b47b02b0a369dd547ba71.js:3099
send @ vendor-775720e92b3b47b02b0a369dd547ba71.js:3254
value @ client-9b76b37d041acebbca8217ffa4663e18.js:16952
value @ client-9b76b37d041acebbca8217ffa4663e18.js:5897
(anonymous) @ vendor-775720e92b3b47b02b0a369dd547ba71.js:2259
value @ client-9b76b37d041acebbca8217ffa4663e18.js:5866
trigger @ vendor-775720e92b3b47b02b0a369dd547ba71.js:3613
n @ vendor-775720e92b3b47b02b0a369dd547ba71.js:3473
n._run @ vendor-775720e92b3b47b02b0a369dd547ba71.js:5357
n._join @ vendor-775720e92b3b47b02b0a369dd547ba71.js:5356
n.join @ vendor-775720e92b3b47b02b0a369dd547ba71.js:5322
h @ vendor-775720e92b3b47b02b0a369dd547ba71.js:3927
(anonymous) @ vendor-775720e92b3b47b02b0a369dd547ba71.js:3627
a @ vendor-775720e92b3b47b02b0a369dd547ba71.js:3845
handleEvent @ vendor-775720e92b3b47b02b0a369dd547ba71.js:3627
handleEvent @ vendor-775720e92b3b47b02b0a369dd547ba71.js:3552
(anonymous) @ vendor-775720e92b3b47b02b0a369dd547ba71.js:3577
dispatch @ vendor-775720e92b3b47b02b0a369dd547ba71.js:1562
g.handle @ vendor-775720e92b3b47b02b0a369dd547ba71.js:1557
r @ vendor-775720e92b3b47b02b0a369dd547ba71.js:29231
vendor-775720e92b3b47b02b0a369dd547ba71.js:20336 WebSocket connection to ‘wss://forestadmin-server.herokuapp.com/subscriptions’ failed: WebSocket is closed before the connection is established.
e.close @ vendor-775720e92b3b47b02b0a369dd547ba71.js:20336
(anonymous) @ vendor-775720e92b3b47b02b0a369dd547ba71.js:20364
r @ vendor-775720e92b3b47b02b0a369dd547ba71.js:29231
setTimeout (async)
(anonymous) @ vendor-775720e92b3b47b02b0a369dd547ba71.js:29267
e.checkMaxConnectTimeout @ vendor-775720e92b3b47b02b0a369dd547ba71.js:20364
e.connect @ vendor-775720e92b3b47b02b0a369dd547ba71.js:20365
(anonymous) @ vendor-775720e92b3b47b02b0a369dd547ba71.js:20362
r @ vendor-775720e92b3b47b02b0a369dd547ba71.js:29231
setTimeout (async)
(anonymous) @ vendor-775720e92b3b47b02b0a369dd547ba71.js:29267
e.tryReconnect @ vendor-775720e92b3b47b02b0a369dd547ba71.js:20362
e.close @ vendor-775720e92b3b47b02b0a369dd547ba71.js:20336
client.onclose @ vendor-775720e92b3b47b02b0a369dd547ba71.js:20371
vendor-775720e92b3b47b02b0a369dd547ba71.js:20336 WebSocket connection to ‘wss://forestadmin-server.herokuapp.com/subscriptions’ failed: WebSocket is closed before the connection is established.
e.close @ vendor-775720e92b3b47b02b0a369dd547ba71.js:20336
(anonymous) @ vendor-775720e92b3b47b02b0a369dd547ba71.js:20364
r @ vendor-775720e92b3b47b02b0a369dd547ba71.js:29231
setTimeout (async)
(anonymous) @ vendor-775720e92b3b47b02b0a369dd547ba71.js:29267
e.checkMaxConnectTimeout @ vendor-775720e92b3b47b02b0a369dd547ba71.js:20364
e.connect @ vendor-775720e92b3b47b02b0a369dd547ba71.js:20365
(anonymous) @ vendor-775720e92b3b47b02b0a369dd547ba71.js:20362
r @ vendor-775720e92b3b47b02b0a369dd547ba71.js:29231
setTimeout (async)
(anonymous) @ vendor-775720e92b3b47b02b0a369dd547ba71.js:29267
e.tryReconnect @ vendor-775720e92b3b47b02b0a369dd547ba71.js:20362
e.close @ vendor-775720e92b3b47b02b0a369dd547ba71.js:20336
(anonymous) @ vendor-775720e92b3b47b02b0a369dd547ba71.js:20364
r @ vendor-775720e92b3b47b02b0a369dd547ba71.js:29231
setTimeout (async)
(anonymous) @ vendor-775720e92b3b47b02b0a369dd547ba71.js:29267
e.checkMaxConnectTimeout @ vendor-775720e92b3b47b02b0a369dd547ba71.js:20364
e.connect @ vendor-775720e92b3b47b02b0a369dd547ba71.js:20365
(anonymous) @ vendor-775720e92b3b47b02b0a369dd547ba71.js:20362
r @ vendor-775720e92b3b47b02b0a369dd547ba71.js:29231
setTimeout (async)
(anonymous) @ vendor-775720e92b3b47b02b0a369dd547ba71.js:29267
e.tryReconnect @ vendor-775720e92b3b47b02b0a369dd547ba71.js:20362
e.close @ vendor-775720e92b3b47b02b0a369dd547ba71.js:20336
client.onclose @ vendor-775720e92b3b47b02b0a369dd547ba71.js:20371

Hello @matt378,

Welcome back to our community!

Could you please share with me the definition of your smart actions from the /forest folder? You can share it in a private message if it contains any sensible data.

Thank you

Hi @olesyak
Thanks for the quick response. you can see in the image attahced:

Thank you for the screenshot.

Is the error present in all the environments? Would you mind removing the description field and try it? I suspect that JSON decoding for non-ASCII characters might be broken.

Please let me know if it helps so I can file a bug report for non-ASCII support

1 Like

Hi @olesyak
Yes. It happens in all environments
There’re other custom actions which also have non-ascii chars which work fine so I don’t think this is the case. Could it be some platform version problem?
screenshot of other smart actions which have non-ascii characters.

Hello @matt378,

Would you mind sharing a text version of your model and action definitions?
It would help us to “play” with it and try to reproduce your issue.

Thank you

Hi @Guillaume_Deslandes
Users.js Below


var Liana = require('forest-express-sequelize');

Liana.collection('user', {
    actions: [{ name: 'Export Users', type: 'global' }]
});

Liana.collection('user', {
    actions: [{ 
        name: 'reject reason',
        fields: [ 
            {
                field: 'reject',
                description: 'סיבת דחיה',
                type: 'Enum',
                enums: ['DB_NoGo', 'loan-income_ratio', 'low_income/capita', 'other']
            }
        ]
    },
    {
        name: 'Rank User',
        type: 'single'
    },
    {
        name: 'Update User Loan',
        type: 'single',
        fields: [ 
            {
                field: 'loanAmount',
                description: 'סכום הלוואה',
                type: 'String',
                isRequired: true
            },
            {
                field: 'loanDuration',
                description: 'משך ההלוואה (חודשים)',
                type: 'String',
                isRequired: true
            },
            {
                field: 'investmentpoolId',
                description: 'מספר מגירת השקעה',
                type: 'String',
                isRequired: true
            }
        ]
    },
    { 
        name: 'Add Investment Fund', type: 'single', 
        fields: [
            {  field: 'amount', type: 'Number', description: 'סכום השקעה כולל', isRequired: true },
            {  field: 'duration', type: 'Number', description: 'משך השקעה כולל', isRequired: true },
            {  field: 'investmentGroup', type: 'Enum', description: 'אפיק השקעה חדש', enums: [ 'A','B','C','D','E' ], isRequired: true }
        ] 
    },
    {
        name: 'Upload additional documents', type: 'single',
        fields: [
            {  field: 'Additional document 1', type: 'File' },
            {  field: 'Additional document 2', type: 'File' },
            {  field: 'Additional document 3', type: 'File' },
            {  field: 'Additional document 4', type: 'File' },
            {  field: 'Additional document 5', type: 'File' },
        ]
    },
    {
        name: 'Attempt to match loans',
        type: 'global'
    },
    {
        name: 'Add credit card',
        type: 'single'
    },
    {
        name: 'Investment Withdrawl', type: 'single',
        fields: [
            {  field: 'investmentGroup', type: 'Enum', description: 'אפיק השקעה', enums: [ 'A','B','C','D','E' ], isRequired: true },
            {  field: 'amount', type: 'Number', description: 'סכום למשיכה', isRequired: true },
        ]
    }
    ]
});

Hi @matt378,

I try to reproduce your Smart Action definition on a random project.
I manage to display the form as expected.

I suspect it could be an internal issue related to the values feature that enable developers to prefill initial values in the Smart Action forms.

Can you confirm that the browser sends a /investment-withdrawl/values request and receives a 404 response? (see the screenshot below)

Hi @Guillaume_Deslandes
Tahnk you so much for trying to help but I am not sure I follow what you asked.
Here’s what I get when filtering the request as showed on the screenshot:

Thanks,

I am wondering why this route answers with a 200 status code.

Did you create a /forest/actions/investment-withdrawl/values route in your admin backend?
Or did you implement this feature?

I feel there is something misconfigured here, that could lead to the issue.

Hi @Guillaume_Deslandes @arnaud

We use an old integration where the Liana is integrated into our server.
Perhaps some backward compatibility broke on your end?

Can you please answer to the questions in my previous post above :point_up: ?
It will help to investigate.

A backward compatibility regression is not the scenario we privilege so far.

@arnaud yes, we implemented the route in our backend:
router.post(’/forest/actions/investment-withdrawl/values’, liana.ensureAuthenticated, investmentWithdrawlValues);

Can you comment this route out and try to trigger the Smart Action again?

Hi @arnaud sorry for the late response, we had a national holiday and it was a (very) long weekend.
comment didn’t help :frowning:

Hey @matt378,

An you do get a 404 on the GET /values after commenting that route, right ?

Hi @vince @arnaud @Guillaume_Deslandes
We figured it out and it’s working! Thanks everyone for the effort.
howardw

1 Like