Outdated `view.state.values` while updating modals with `response_action: update`
See original GitHub issueDescription
Randomly getting outdated view.state.values
while updating modals with response_action: update
What type of issue is this?
- bug
- enhancement (feature request)
- question
- documentation related
- testing related
- discussion
Requirements
- I’ve read and understood the Contributing guidelines and have done my best effort to follow them.
- I’ve read and agree to the Code of Conduct.
- I’ve searched for any related issues and avoided creating a duplicate issue.
Bug Report
The problem is that I’m randomly getting outdated view.state.values
while updating modals with response_action: update
. I’ve attached logs of view object, where you can see, that even block_id: 'answer_view100'
when user submits modal — I’m getting outdated state values, from the two screens before: { values: { answer_view98: [Object] } }
For my task I’m updating one modal from 10 to 20 times, each update contains different input blocks. After each submission I’m collecting data and updating the view with next input block. block_id
and action_id
are uniq for each user session (but not uniq across whole app).
That’s how I’m updating view:
const ackData = {
response_action: 'update',
view: modalView
};
await ack(ackData);
My main question: Why it could happen? Please point me in some direction. Maybe I’m doing something wrong.
I haven’t tried to switch to views.update yet, due to lack of time.
Reproducible in:
package version: 2.1.1
node version: v13.11.0
OS version(s): Ubuntu 16.04.5 LTS (GNU/Linux 4.4.0-151-generic x86_64)
Steps to reproduce:
Sadly I’m not figured out exact steps. But such staff usually happening in rush hours, when 100-200 people simultaneously are using app. And with ~10% of that group of people, for majority everything is working fine.
Expected result:
I’m expecting to get view.state.values
with actual data every time, I use it.
Actual result:
Sometimes I’m getting view.state.values
with outdated data.
Attachments:
This is console log of the view
that I’m getting when user submit modal.
{
id: 'V01AKKN7Y02',
team_id: 'T018PBTQPRD',
type: 'modal',
blocks: [
{ type: 'header', block_id: 'mg=Q6', text: [Object] },
{ type: 'section', block_id: 'dBs', text: [Object] },
{ type: 'divider', block_id: 'HkT0' },
{ type: 'header', block_id: 'v/WSm', text: [Object] },
{ type: 'section', block_id: 'OXlae', text: [Object] },
{ type: 'section', block_id: 'sM0', text: [Object] },
{ type: 'section', block_id: 'Ozoq1', text: [Object] },
{ type: 'section', block_id: 'F2Wp', text: [Object] },
{
type: 'input',
block_id: 'answer_view100',
label: [Object],
optional: false,
element: [Object]
}
],
private_metadata: '{"actionID": 44, "submitterID": 319, "testID": 10030, "questionID": 100}',
callback_id: 'NEXT_QUESTION',
state: { values: { answer_view98: [Object] } },
hash: '1599946164.CIXMSAQG',
title: { type: 'plain_text', text: 'Тест', emoji: true },
clear_on_close: false,
notify_on_close: true,
close: { type: 'plain_text', text: 'Later', emoji: true },
submit: { type: 'plain_text', text: 'Submit', emoji: true },
previous_view_id: null,
root_view_id: 'V01AKKN7Y02',
app_id: 'A018JCZ81DY',
external_id: '',
app_installed_team_id: 'T018PBTQPRD',
bot_id: 'B019U8E32SX'
}
Also there is a different odd behaviour of view.state, in one of the logs, I found whole history of view updates.
state: {
values: {
answer_view90: [Object],
answer_view89: [Object],
answer_view94: [Object],
answer_view92: [Object],
answer_view95: [Object],
answer_view93: [Object],
answer_view91: [Object]
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (3 by maintainers)
@seratch Hey, thanks! I’ll try to test it in a week or two, since I need to wait scheduled events.
@Wert1go I’ve escalated this issue to the server-side teams and now they are aware of it.
The server-side team is actively working on code improvements right now. They are expecting the changes will resolve the existing bugs including this issue. I cannot tell the exact release date of the changes yet, but we will update you accordingly.