element-android icon indicating copy to clipboard operation
element-android copied to clipboard

Cannot send Custom State event

Open chitrangad opened this issue 2 years ago • 4 comments

Steps to reproduce

Hello I'm running into an issue while trying to set the retention. I'm using Element Android ver 1.5.26 I keep getting 'Malformed JSON' when I try to send the m.room.retention event via dev tools

Steps:

  1. Go to the room settings and open Dev Tools-> Send custom event
  2. Type: m.room.retention content: {"max_lifetime": 8640000}.
  3. Send event

Outcome

What did you expect?

State event sent successfully and room state updated

What happened instead?

Receives error "Malformed JSON I've searched around and validated the JSON string format but cannot get it to work. Any help would be greatly appreciated

Your phone model

Pixel 7

Operating system version

Android 12

Application version and app store

1.5.26

Homeserver

Matrix/Synapse homeserver

Will you send logs?

Yes

Are you willing to provide a PR?

Yes

chitrangad avatar Mar 08 '23 02:03 chitrangad

Hi - Any update on the issue? Or, if there's an alternative way to send the retention event.

chitrangad avatar Mar 12 '23 18:03 chitrangad

Why did you choose send custom event and not send state event?

rriemann avatar Feb 14 '24 07:02 rriemann

From my debugging it happens because at RoomDevToolsViewModel.kt sendEventContent function when content is being converted by jsonAdapter it converts the "max_lifetime" to Double instead of Int or Long and the server side expects Long. Hope will help you

unplugged-maksim avatar Feb 19 '24 09:02 unplugged-maksim

Why did you choose send custom event and not send state event?

Its found under Explore Room State -> user-defined event (don't know exact English translation as i have it in German).

SvenXP avatar Jun 13 '24 14:06 SvenXP