matchEnd Invoked twice

Issue Description:
matchEnd event is invoked twice
Steps to reproduce:

  1. start PUBG match solo.
  2. get killed by enemy.
  3. press spectate button.
  4. leave match (exit to lobby).

note: i noticed this issue while playing solo, not sure if it exists in other modes like due or squad.

Impact for my app: high

you can see at the bottom that “EVENT FIRED: {“events”:[{“name”:“matchEnd”, “data”:”“}]}”
is shown twice.

Please attach a zip package of your logs
(i could not find zip file upload option)

hi @samer,

We are indeed sending matchEnd event when you are killed, and another matchEnd when you return to the lobby. If you return to the lobby before you get killed, you will see only one matchEnd.

Can you please tell me what is the pain point for you with this behavior?
Anyway, we will update the docs to make it more transparent.

Thanks,
Eran

but you told me it’s not suppose to behave like that, also why would it fire when the players dies if you have the death event, also having it triggered twice on two different scenarios is bad because it will be challenging for the developer to work with it, and events are suppose to be triggered on a very specific scenario and not two different ones.
lets say I want to use it, what do you think is the best way to use for?

I’m sorry for the misunderstood, but after discussing that internally, it looks that this behavior is by design, and not a bug: the reason that we are firing the matchEnd immediately after the player dies, is because most of the apps treat a player death as an actual end of the match

What exactly are you trying to achieve in your app? If you want to know when the player actually exits to the lobby, and the endMatch is not good enough for you (as the user can still spectate for example) - you can use phase feature, that give you the current game state (‘lobby’, ‘loading_screen’, ‘airfield’ etc.). You can listen to game info to get notified when the user is back to the lobby.

The purpose of event is to let the developer know that this has happened, if it fires more that ones on different scenarios the developer won’t be able to know what scenario is happening and that defeats the purpose of an event.
if i double click an element, an ondbclick is fired, the onclick doesn’t fire twice,it’s made this way so the developer controls the behavior of his app, you need to make sure that the developers who’s using your API knows what’s happening!!

In general, you are right. But you have to remember that OnClick is an “absolute” binary event and matchEnd is a “logical” event that we defined, to let the app developers knows when the match is ended. It’s not a PUBG event - we set it and decided when it fired. In the past, we got some request to defined it like this (when the player has died and when the user exit to the lobby). In retrospect - it would be better if we chose to implement it as you suggested (fire it only when the user exit to the lobby), but change the logic now may break some existing apps that relay on this behavior and logic.
Anyway, we are trying to improve all the time, and we will use this insight for future developments. So thanks for these notes. I forward this issue to the relevant team.