[GH-ISSUE #3236] [bug]: XML Body disappearing #1070

Closed
opened 2026-03-16 18:23:08 +03:00 by kerem · 4 comments
Owner

Originally created by @thomashanke on GitHub (Aug 4, 2023).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/3236

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

When I enter a more complex XML body for a request with content type application/xml and I send some requests, after some time the XML body disappears (Body Tab, Raw Request Body) and is no longer displayed.
The body is still available and sent when I send a request but it is no longer displayed.
I can only change it if I clear the body (with the trashcan icon) and then enter it agan

Steps to reproduce

  1. Create a POST request
  2. Go to Body, enter content type application/xml
  3. enter a bigger XML as Raw Request Body
  4. send the request
  5. Save the request
  6. Close the request tab, click around in the UI, open the request again
  7. Go to the Body tab
  8. Raw Request Body is not displayed
  9. Send the request and detect that the body is still available but not displayed

Environment

Production

Version

Self-hosted

Originally created by @thomashanke on GitHub (Aug 4, 2023). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/3236 ### Is there an existing issue for this? - [X] I have searched the existing issues ### Current behavior When I enter a more complex XML body for a request with content type application/xml and I send some requests, after some time the XML body disappears (Body Tab, Raw Request Body) and is no longer displayed. The body is still available and sent when I send a request but it is no longer displayed. I can only change it if I clear the body (with the trashcan icon) and then enter it agan ### Steps to reproduce 1. Create a POST request 2. Go to Body, enter content type application/xml 3. enter a bigger XML as Raw Request Body 4. send the request 5. Save the request 6. Close the request tab, click around in the UI, open the request again 7. Go to the Body tab 8. Raw Request Body is not displayed 9. Send the request and detect that the body is still available but not displayed ### Environment Production ### Version Self-hosted
kerem 2026-03-16 18:23:08 +03:00
Author
Owner

@thomashanke commented on GitHub (Aug 7, 2023):

I also managed to reproduce the issue with the version that is not self hosted.
Steps to reproduce:

  1. Create a POST request to https://echo.hoppscotch.io with the following body (contains an environment variable)
    `
    <msg:RequestMessage xmlns:msg="http://www.foo.com/TC57/2011/schema/message" xmlns:m="http://www.foo.com/TC57/CIM-abc#">
    msg:Header
    msg:Verbcreate</msg:Verb>
    msg:NounMeterConfig</msg:Noun>
    </msg:Header>
    msg:Payload
    <m:MeterConfig>
    <m:Meter>
    <m:mRID><></m:mRID>
    <m:amrSystem>METER_AMR_SYSTEM</m:amrSystem>
    <m:isVirtual>false</m:isVirtual>
    <m:serialNumber>Serial - 10137616</m:serialNumber>
    <m:timeZone>Europe/Berlin</m:timeZone>
    <m:timeZoneOffset>120</m:timeZoneOffset>

     		<m:lifecycle>
     			<m:installationDate>2019-01-01</m:installationDate>
     		</m:lifecycle>
     	</m:Meter>
     	<m:ReadingType>
     		<m:Names>
     			<m:name>0.0.2.4.1.1.12.0.0.0.0.0.0.0.0.3.72.0</m:name>
     			<m:NameType>
     				<m:name>NameType</m:name>
     				<m:NameTypeAuthority>
     					<m:name>NameTypeAuthority</m:name>
     				</m:NameTypeAuthority>
     			</m:NameType>
     		</m:Names>
     	</m:ReadingType>			
     </m:MeterConfig>
    

    </msg:Payload>
    </msg:RequestMessage>

`

Set the content type of the body to aplication/xml
Add a Pre-Request Script that contains
pw.env.set("Meter", "value");

  1. Save the request as "Untitled" in a new collection with name "a"
  2. Create a second request. The second request is a GET request to https://echo.hoppscotch.io and stored as "Untitled1" in the collection "a"
  3. switch to POST request "Untitled"
  4. send POST request "Untitled"
  5. switch to GET request "Untitled1"
  6. send GET request "Untitled1"
  7. switch to tab Pre-Request Script in GET request "Untitled1"
  8. switch to POST request "Untitled" and tab "Body"
  9. Request Body now is gone!
  10. Send POST request "Untitled". Echo shows received XML, so body is still there but is not displayed.
  11. If Body is deleted with trashcan icon, you can add a new body, but you never see the original body again
<!-- gh-comment-id:1667300501 --> @thomashanke commented on GitHub (Aug 7, 2023): I also managed to reproduce the issue with the version that is **not** self hosted. Steps to reproduce: 1. Create a POST request to https://echo.hoppscotch.io with the following body (contains an environment variable) `<?xml version="1.0" encoding="UTF-8"?> <msg:RequestMessage xmlns:msg="http://www.foo.com/TC57/2011/schema/message" xmlns:m="http://www.foo.com/TC57/CIM-abc#"> <msg:Header> <msg:Verb>create</msg:Verb> <msg:Noun>MeterConfig</msg:Noun> </msg:Header> <msg:Payload> <m:MeterConfig> <m:Meter> <m:mRID><<Meter>></m:mRID> <m:amrSystem>METER_AMR_SYSTEM</m:amrSystem> <m:isVirtual>false</m:isVirtual> <m:serialNumber>Serial - 10137616</m:serialNumber> <m:timeZone>Europe/Berlin</m:timeZone> <m:timeZoneOffset>120</m:timeZoneOffset> <m:lifecycle> <m:installationDate>2019-01-01</m:installationDate> </m:lifecycle> </m:Meter> <m:ReadingType> <m:Names> <m:name>0.0.2.4.1.1.12.0.0.0.0.0.0.0.0.3.72.0</m:name> <m:NameType> <m:name>NameType</m:name> <m:NameTypeAuthority> <m:name>NameTypeAuthority</m:name> </m:NameTypeAuthority> </m:NameType> </m:Names> </m:ReadingType> </m:MeterConfig> </msg:Payload> </msg:RequestMessage> >>` Set the content type of the body to aplication/xml Add a Pre-Request Script that contains `pw.env.set("Meter", "value");` 2. Save the request as "Untitled" in a new collection with name "a" 3. Create a second request. The second request is a GET request to https://echo.hoppscotch.io and stored as "Untitled1" in the collection "a" 4. switch to POST request "Untitled" 5. send POST request "Untitled" 6. switch to GET request "Untitled1" 7. send GET request "Untitled1" 8. switch to tab Pre-Request Script in GET request "Untitled1" 9. switch to POST request "Untitled" and tab "Body" 10. Request Body now is gone! 11. Send POST request "Untitled". Echo shows received XML, so body is still there but is not displayed. 12. If Body is deleted with trashcan icon, you can add a new body, but you never see the original body again
Author
Owner

@aciokler commented on GitHub (Aug 14, 2023):

I get the same issue. Complex xml bodies create errors in the browser console.

runtime-core.esm-bundler.js:228 Error: Found multiple root nodes
    at o (index.js:27:23)
    at v (index.js:231:12)
    at u (index.js:157:47)
    at Zy (codemirror.ts:167:12)
    at O (codemirror.ts:286:14)
    at codemirror.ts:294:24
    at runtime-core.esm-bundler.js:2739:40
    at Ca (runtime-core.esm-bundler.js:157:22)
    at ki (runtime-core.esm-bundler.js:166:21)
    at e.__weh.e.__weh (runtime-core.esm-bundler.js:2713:29)
throwUnobservableError.js:2 Uncaught TypeError: You provided an invalid object where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.
    at DU (throwUnobservableError.js:2:12)
    at pD (innerFrom.js:37:11)
    at GU (from.js:4:54)
    at combineLatest.js:38:34
    at _S (combineLatest.js:67:9)
    at s (combineLatest.js:37:17)
    at combineLatest.js:57:17
    at _S (combineLatest.js:67:9)
    at A._subscribe (combineLatest.js:31:9)
    at A._trySubscribe (Observable.js:38:25)

I believe this is causing the xml to disappear

<!-- gh-comment-id:1677711195 --> @aciokler commented on GitHub (Aug 14, 2023): I get the same issue. Complex xml bodies create errors in the browser console. ``` runtime-core.esm-bundler.js:228 Error: Found multiple root nodes at o (index.js:27:23) at v (index.js:231:12) at u (index.js:157:47) at Zy (codemirror.ts:167:12) at O (codemirror.ts:286:14) at codemirror.ts:294:24 at runtime-core.esm-bundler.js:2739:40 at Ca (runtime-core.esm-bundler.js:157:22) at ki (runtime-core.esm-bundler.js:166:21) at e.__weh.e.__weh (runtime-core.esm-bundler.js:2713:29) ``` ``` throwUnobservableError.js:2 Uncaught TypeError: You provided an invalid object where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable. at DU (throwUnobservableError.js:2:12) at pD (innerFrom.js:37:11) at GU (from.js:4:54) at combineLatest.js:38:34 at _S (combineLatest.js:67:9) at s (combineLatest.js:37:17) at combineLatest.js:57:17 at _S (combineLatest.js:67:9) at A._subscribe (combineLatest.js:31:9) at A._trySubscribe (Observable.js:38:25) ``` I believe this is causing the xml to disappear
Author
Owner

@ghost commented on GitHub (Oct 6, 2023):

I am also able to reproduce this locally hosted. Anyone have a work around?

<!-- gh-comment-id:1749880606 --> @ghost commented on GitHub (Oct 6, 2023): I am also able to reproduce this locally hosted. Anyone have a work around?
Author
Owner

@joeljstephen commented on GitHub (Apr 10, 2024):

@thomashanke This issue will be closed in a few days as it has been fixed. Please let us know if you are still facing this issue in the latest builds.

<!-- gh-comment-id:2047530985 --> @joeljstephen commented on GitHub (Apr 10, 2024): @thomashanke This issue will be closed in a few days as it has been fixed. Please let us know if you are still facing this issue in the latest builds.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#1070
No description provided.