Fix: Resolve redundant callbacks and missing payloads in HttpRequest#7475
Fix: Resolve redundant callbacks and missing payloads in HttpRequest#7475lavjeetrai wants to merge 1 commit into
Conversation
|
🧪 Jest Test Results ❌ Some Jest tests failed. Please check the logs and fix the issues before merging. Coverage: Statements: 48.29% | Branches: 39.89% | Functions: 53% | Lines: 48.69% Note: These failures may be introduced by this PR or may already exist in the master branch. Failed Tests: |
|
The aidebugger.test.js failure is an existing issue currently failing on master. I verified this locally—it is completely unrelated to my changes. |
|
@Ashutoshx7 can u reveiw this pr when u have time ? |
|
@walterbender can u have a loook to these changess when got time ? |
Summary
Refactors the legacy
HttpRequestconstructor to useonloadandonerrorinstead ofonreadystatechange. This prevents callbacks from firing multiple times per request and fixes a bug whereuserCallbackwas ignored on success.Eliminates wasteful, redundant executions of
loadCallback(which previously fired on ready states 1, 2, 3, and 4) and ensures successful network payloads are actually passed back to the requesting function.Category