question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Outdated `view.state.values` while updating modals with `response_action: update`

See original GitHub issue

Description

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:closed
  • Created 3 years ago
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Wert1gocommented, Jul 12, 2021

@seratch Hey, thanks! I’ll try to test it in a week or two, since I need to wait scheduled events.

1reaction
seratchcommented, Nov 18, 2020

@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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using modals in Slack apps
A view can be updated to change the layout or the underlying state. This update can happen whether or not the view is...
Read more >
Modals | Slack SDK for Java
Sending a body with response_action (possible values are "errors" , "update" , "push" , "clear" ). import com.slack.api.model.view.ViewState; import java ...
Read more >
React Modal Updater doesn't refresh page after setState()
Issue. I think the issue is a simple one; you've used defaultValue for the disabled inputs on the AllInOneProjectPage component. When an ...
Read more >
slack - Go Packages
Values, error); func ValidateUniqueBlockID(view ModalViewRequest) bool ... RTM] A channel purpose was updated MsgSubTypeChannelName = "channel_name" ...
Read more >
Minimum Standards for Child-Care Centers
When a report alleges a violation of minimum standards, rule, or law, ... You must keep the updated information in the child's record....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found