postman-app-support icon indicating copy to clipboard operation
postman-app-support copied to clipboard

Postman VS code extension not returning API response for tasks that run for a few minutes

Open femikolade opened this issue 8 months ago • 0 comments
trafficstars

Is there an existing issue for this?

  • [x] I have searched the tracker for existing similar issues and I know that duplicates will be closed

Describe the Issue

In Postman for VS Code, requests that run for a few minutes do not return the API's response after completing the API's task. On desktop Postman, request completes after running task for the same amount of time.

The code runs in VS code in a remote server and port forwarding to the host.

A simple example is written in Go where a sleep is used to make the request run for 5 mins. Also tested in Python.

package main

import (
	"encoding/json"
	"fmt"
	"log"
	"net/http"
	"time"
)

type RespMsg struct {
	Msg string `json:"message"`
}

func handler(w http.ResponseWriter, r *http.Request) {

	fmt.Printf("started at : %v\n", time.Now())
	msg := RespMsg{Msg: "Completed"}

	jsonStr, err := json.Marshal(msg)

	time.Sleep(300 * time.Second)

	if err != nil {
		http.Error(w, err.Error(), http.StatusInternalServerError)
		return
	}

	fmt.Printf("completed at : %v\n", time.Now())

	w.Write(jsonStr)
}

func main() {
	http.HandleFunc("/", handler)
	log.Fatal(http.ListenAndServe(":8080", nil))
}

The VScode postman prints fmt.Printf("completed at : %v\n", time.Now()) but does not return the json string.

Steps To Reproduce

  1. connect to a remote server/container.
  2. using Postman for VS code, run an http service that takes minutes to complete, say 5 minutes

Screenshots or Videos

Image Stuck at sending request even after task is completed. Next image shows the task prints out the completed line of the code. Image

In the logs, the first 'started' is from the Postman VS code while the second is from Postman Desktop. Same for the completed in the logs.

For Postman desktop, the request printed completed and sends the response.

Image

Operating System

Linux

Postman Version

1.8.1

Postman Platform

Postman VSCode Extension

User Account Type

Signed In User

Additional Context?

No response

femikolade avatar Mar 05 '25 16:03 femikolade