brainboxdotcc / DPP

C++ Discord API Bot Library - D++ is Lightweight and scalable for small and huge bots!
https://dpp.dev/
Apache License 2.0
1.04k stars 158 forks source link

dpp::discord_voice_client: track_meta is not cleared when stop_audio() is called #1124

Closed KontraCity closed 3 months ago

KontraCity commented 4 months ago

Git commit reference 89b43ba1445f99114f1c583529d01ad210918c35

Describe the bug When voice client's stop_audio() is called, all 2-byte markers 0xFFFF in outbuf are deleted, however track_meta vector is not cleared.

To Reproduce Steps to reproduce the behavior:

  1. Send a voice marker with metadata "ABC"
  2. Call stop_audio()
  3. Send another voice marker with metadata "DEF"
  4. When on_voice_track_marker() callback is called by DEF marker, event.track_meta is ABC. One marker was inserted after stop_audio(), but track_meta size is 2, so event.track_meta contains metadata from "deleted" marker.

Expected behavior All markers metadata should be deteled when stop_audio() is called. The second marker in the example should have event.track_meta = "DEF" instead of "ABC"

System Details:

Suggested solution Adding this->track_meta.clear() at /src/dpp/discordvoiceclient.cpp at line 695.

Neko-Life commented 4 months ago

Yes I think this should be fixed, especially it seems like all the old uncleared meta is just becoming garbage that stays until maybe the voice client is destroyed. This might be breaking change to bot that mitigated the behavior but still I think it's a bug, and ofc we all hate bugs :))

Jaskowicz1 commented 4 months ago

Yes I think this should be fixed, especially it seems like all the old uncleared meta is just becoming garbage that stays until maybe the voice client is destroyed. This might be breaking change to bot that mitigated the behavior but still I think it's a bug, and ofc we all hate bugs :))

nah idk bugs are cool man

KontraCity commented 3 months ago

Fixed by #1127