AnWeber / httpbook

Quickly and easily send REST, Soap, GraphQL, GRPC, MQTT and WebSocket requests directly within Visual Studio Code
https://httpyac.github.io/
MIT License
57 stars 4 forks source link

Block order gets lost #74

Closed UndefinedOffset closed 1 year ago

UndefinedOffset commented 1 year ago

It looks like the order of blocks in the notebook can get lost, for example on creation the blocks are ordered like so: initial-order

Which results in the following being saved to the filesystem:


/*
## Test
*/

/*
#### Test 1
*/

{{@response
    global.api_token = JSON.parse(response.body).token;
}}
POST https://example.com/api/auth/mfa HTTP/1.1
Content-Type: application/json
{
    "email": "{{httpbook_email}}",
    "pwd": "{{httpbook_password}}",
    "code": "123456"
}

/*
#### Test 2
*/

###

{{@response
    global.api_token = JSON.parse(response.body).token;
}}
POST https://example.com/api/auth/login HTTP/1.1
Content-Type: application/json
{
    "email": "{{httpbook_email}}",
    "pwd": "{{httpbook_password}}"
}

However after closing then re-opening it looks like this: second-open-order

Here's the VSCode details:

Version: 1.71.2 (user setup) Commit: 74b1f979648cc44d385a2286793c226e611f59e7 Date: 2022-09-14T21:03:37.738Z Electron: 19.0.12 Chromium: 102.0.5005.167 Node.js: 16.14.2 V8: 10.2.154.15-electron.0 OS: Windows_NT x64 10.0.19043 Sandboxed: No

Also I have httpbook.saveWithOutputs off but the issue happens with it on as well.

AnWeber commented 1 year ago

There was an error in parsing the regions here. Since all 3 comments are assigned to the first region, this was rendered before the actual code block. I also noticed a blank line bug, which I tried to fix right away. Thanks for the good bug report. Bug is fixed with 3.1.5