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

Inconsistencies with interaction response types. #3441

Closed
GoldenAngel2 opened this issue Jul 13, 2021 · 2 comments
Closed

Inconsistencies with interaction response types. #3441

GoldenAngel2 opened this issue Jul 13, 2021 · 2 comments
Labels
message components click click click click click click click

Comments

@GoldenAngel2
Copy link
Contributor

Description
When responding to a select interaction with a message it doesn't reset the state for the user.
(but responding with type: 7 it does reset the state for the user, but you can't respond with a message)

Steps to Reproduce

{ "type": 4, "data": { "content": "test", "flags": 64  } }
  • For a message response (doesn't reset the state)
{ "type": 7 }
  • For the state to reset.

Expected Behavior
Both should reset the state for the user.

Current Behavior
It doesn't reset the state for type: 4

Screenshots/Videos

Type 7:

gif

Type 4:

gif

Client and System Information
OS: Windows 10
Discord API Version: 9

@GoldenAngel2 GoldenAngel2 added the message components click click click click click click click label Jul 13, 2021
@ckohen
Copy link
Contributor

ckohen commented Jul 14, 2021

I believe the incorrect behavior is what you displayed with type 7 actually. IIRC selects are supposed to locally retain state unless the component is updated. It appears the component is being "updated" even though it should not.

@night
Copy link
Member

night commented Mar 17, 2022

This behavior looks correct to me. By sending type 7 you are submitting a message update to our server, which is then triggering a MESSAGE_UPDATE event that causes a rerender of the message in clients (telling the client to set the defaults back for components in the message). As stated above components are locally stored state, so the only way to keep persisted state is to set those values as new defaults when updating the message.

@night night closed this as completed Mar 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
message components click click click click click click click
Projects
None yet
Development

No branches or pull requests

3 participants