Telegram-iOS icon indicating copy to clipboard operation
Telegram-iOS copied to clipboard

[Web Apps] "popup_closed" event contains incorrect payload

Open heyqbnk opened this issue 3 years ago • 0 comments

Checklist

  • [x] I am reporting an issue in existing functionality that does not work as intended
  • [x] I've searched for existing GitHub issues

Description

According to official popup_closed documentation, in case no button was clicked, we should receive empty object ({}), but not null.

Expected Behavior

popup_closed event should contain {} payload in case, no button were clicked.

Actual Behavior

popup_closed payload contains null.

Steps to Reproduce

  1. Open Web Apps polygon bot (source code)
  2. Open developers tools (F12)
  3. Call Web Apps method:
bridge.postEvent('web_app_open_popup', {
    title: 'Title',
    message: 'Message',
    buttons: [{type: 'ok', id: 'ok'}]
})
  1. Close popup by clicking outside or by clicking popup top right cross
  2. See log in console:
[...] [Bridge] [processEvent] popup_closed null

It means, application received event popup_closed with payload presented as null.

Environment

Device: iPhone XR

iOS version: 16.1.1

App version: 9.3.2

heyqbnk avatar Jan 21 '23 22:01 heyqbnk