Skip to content

timed_out in net._http_response is always NULL #180

@diraneyya

Description

@diraneyya

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

Both functions http_get and http_post on the pg_net extension offer a timeout parameter in milliseconds.

This parameter works (unlike mentions of it not working), and indeed the requests are halted when they take longer than this amount of time.

Since http request failure can occur for a variety of reasons, of which a timeout is one such reason, it is advantageous, and indeed the case, that a timed_out column exists in the schema of the net._http_response table.

However, and contrary to expectation, the value of this column is always null, even when the error_msg strictly states a timeout.

To Reproduce

with t as (
    select random(0, 100) as t1, random(0, 100) as t2
)
select
    net.http_get(
        url := 'https://postman-echo.com/get',
        params := '{"key1": "value", "key2": 5}'::jsonb,
        timeout_milliseconds := t.t1
    ) as req_id_get,
    net.http_post(
        url := 'https://postman-echo.com/post',
        body := '{"key1": "value", "key2": 5}'::jsonb,
        timeout_milliseconds := t.t2
    ) as req_id_post from t;

This gives:

req_id_get  req_id_post
7 8

Where net._http_response shows:

id status_code content_type headers content timed_out error_msg created
7 NULL NULL NULL NULL NULL Timeout of 72 ms reached ... 2025-04-10 12:41:50.712235+02
8 NULL NULL NULL NULL NULL Timeout of 34 ms reached ... 2025-04-10 12:41:50.712235+02

Expected behavior

id status_code content_type headers content timed_out error_msg created
7 NULL NULL NULL NULL TRUE Timeout of 72 ms reached ... 2025-04-10 12:41:50.712235+02
8 NULL NULL NULL NULL TRUE Timeout of 34 ms reached ... 2025-04-10 12:41:50.712235+02

Screenshots

NA

System information

  • OS: Proxmox
  • pg_net version: 0.14.0
  • PostgreSQL version: 17

Additional context

I installed two triggers in pg_net tables, both on row level, before insert, for both request queue and response tables.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions