Fix Unreal heartbeat response parsing delays caused by incorrect completion and status checks#196
Draft
Fix Unreal heartbeat response parsing delays caused by incorrect completion and status checks#196
Conversation
…ck with request status check and fix response code validation The ReceiveHeartbeat() method had two bugs: 1. Content length check compared string character count with HTTP byte count, which fails for non-ASCII UTF-8 or chunked transfer encoding, silently dropping valid responses. 2. Response code check only rejected >= 300, allowing code 0 (connection failures) through to JSON parsing of empty bodies. Fix: Use EHttpRequestStatus to properly detect completed requests, check response code is in 200-299 range, and guard against empty response bodies. Co-authored-by: dgkanatsios <8256138+dgkanatsios@users.noreply.github.com>
…ature queue removal Co-authored-by: dgkanatsios <8256138+dgkanatsios@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix Unreal Heart Beat successful parsing delay
Fix Unreal heartbeat response parsing delays caused by incorrect completion and status checks
Mar 3, 2026
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.
What this PR does / why we need it:
ReceiveHeartbeat()has two bugs that cause heartbeat responses to be silently dropped or incorrectly processed, delaying session config population (sessionId, metadata, etc.) by up to ~10 minutes.Bug 1: Content length check compares incompatible units
FString::Len()returns character count;GetContentLength()returns byte count. These diverge with non-ASCII UTF-8 or chunked transfer encoding (noContent-Lengthheader), silently dropping valid responses. No other SDK (C#, C++, Java) performs this check.Bug 2: Response code 0 passes the error check
Connection failures yield response code 0 with an empty body. This reaches
DecodeHeartbeatResponse(""), which fails JSON parsing and logs "Failed to parse heartbeat" every cycle.Fix:
EHttpRequestStatuscompletion detectionbreak(notcontinue) for incomplete requests — thekillIndex-based removal deletes entries0..killIndex, so skipping an incomplete request at index N while processing index N+1 would incorrectly remove the incomplete oneSpecial notes for your reviewer:
Both the source copy (
UnrealPlugin/Source/) and the TestingProject copy (UnrealPlugin/TestingProject/Plugins/) are updated identically. Unreal automation tests require the Editor and have no CI workflow, so changes were verified by code inspection and cross-referenced against C#/C++/Java SDK heartbeat handling.If applicable:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.