Fix/websocket event cleanup#646
Merged
scottdraves merged 1 commit intoMay 22, 2026
Merged
Conversation
…noise CLog::Error was calling PlatformUtils::NotifyError(_pFmt) before the grabvarargs macro had expanded the format string, so NotifyError received the raw format string (e.g. "Unknown event type received: %s") and printed it literally via fprintf(stderr, "[ERROR] %.*s\n", ...). Fix by moving the NotifyError call to after grabvarargs so it receives the already-formatted pTempStr. WebSocket event handler (EDreamClient.cpp): - Add a WsEvent namespace with constexpr std::string_view constants for all 31 known event names, replacing the inline string literals in the handler. This avoids per-comparison std::string construction and makes the set of known events easy to audit at a glance. - Handle the "playing" event explicitly (server acknowledgement of our state_sync) — previously fell through to the error branch, flooding the log with spurious errors on every dream transition. - Remove stray debug printf calls (bare "Received websocket message: %s" and "Frame number: ...") that were writing to stdout with no newline, interleaving with the structured log output. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
dc98ec1 to
ff86c78
Compare
Collaborator
Author
|
Oops, initially contained #645 - now rebased on master and force pushed. I don't like force-pushing, but it's only to my fork so who cares - it's all the same thing when we squash & merge. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix: correct g_Log->Error format-string output and silence 'playing' noise.
CLog::Error was calling PlatformUtils::NotifyError(_pFmt) before the grabvarargs macro had expanded the format string, so NotifyError received the raw format string (e.g. "Unknown event type received: %s") and printed it literally via fprintf(stderr, "[ERROR] %.*s\n", ...). Fixed by moving the
NotifyErrorcall to aftergrabvarargsso it receives the already-formatted pTempStr.WebSocket event handler (EDreamClient.cpp):
Add a WsEvent namespace with constexpr std::string_view constants for all 31 known event names, replacing the inline string literals in the handler. This avoids per-comparison std::string construction and makes the set of known events easy to audit at a glance.
Handle the "playing" event explicitly (server acknowledgement of our state_sync) — previously fell through to the error branch, flooding the log with spurious errors on every dream transition.
Remove stray debug printf calls (bare "Received websocket message: %s" and "Frame number: ...") that were writing to stdout with no newline, interleaving with the structured log output.