• Bug#1108818: [Pkg-javascript-devel] Bug#1108818: node-superagent: autop

    From =?UTF-8?B?SsOpcsOpbXkgTGFs?=@21:1/5 to All on Sun Jul 6 12:50:01 2025
    Le dim. 6 juil. 2025 à 08:13, Yadd <[email protected]> a écrit :

    On 7/5/25 15:32, Paul Gevers wrote:
    Source: node-superagent
    Version: 9.0.1-1
    Severity: serious
    User: [email protected]
    Usertags: regression

    Dear maintainer(s),

    Your package has an autopkgtest, great. However, it fails since June
    2025. Can you please investigate the situation and fix it? I copied some
    of the output at the bottom of this report.

    The release team has announced [1] that failing autopkgtest on amd64 and arm64 are considered RC in testing.

    More information about this bug and the reason for filing it can be
    found on https://wiki.debian.org/ContinuousIntegration/ RegressionEmailInformation

    With my Release Team member hat on I allow you to tag this bug as trixie-ignore if this is nearly completely a test issue as it's so late
    in the freeze and it's not worth removing the package from trixie
    because of a failing test at this moment unless it exposes a much bigger issue. Having said that, if this is a test only issue and a fix is
    possible without fully removing the autopkgtest and without making the
    test superficial, it's still welcome, but it would need to happen soon.

    Paul

    [1] https://lists.debian.org/debian-devel-announce/2019/07/msg00002.html

    https://ci.debian.net/data/autopkgtest/testing/amd64/n/node- superagent/62133275/log.gz

    105s 1) Agent
    105s should remember defaults:
    105s
    105s AssertionError [ERR_ASSERTION]: 0 == 1
    105s + expected - actual
    105s
    105s -0
    105s +1
    105s
    105s at Context.<anonymous> (test/agent-base.js:33:12)
    105s at callFn (/usr/share/nodejs/mocha/lib/runnable.js:364:21)
    105s at Runnable.run
    (/usr/share/nodejs/mocha/lib/runnable.js:352:5)
    105s at Runner.runTest
    (/usr/share/nodejs/mocha/lib/runner.js:677:10)
    105s at /usr/share/nodejs/mocha/lib/runner.js:800:12
    105s at next (/usr/share/nodejs/mocha/lib/runner.js:592:14)
    105s at /usr/share/nodejs/mocha/lib/runner.js:602:7
    105s at next (/usr/share/nodejs/mocha/lib/runner.js:485:14)
    105s at Immediate._onImmediate (/usr/share/nodejs/mocha/lib/ runner.js:570:5)
    105s at process.processImmediate (node:internal/timers:483:21)
    105s
    105s
    105s
    105s autopkgtest [13:05:26]: test pkg-js-autopkgtest: -----------------------]
    Hi Jérémy,

    the broken test is test/agent-base.js, even with more recent
    node-superagent and a "npm instll", test still fail.

    The problem is that the initialization of "agent" return undefined when ".query({ hello: 'world' })" is set. I can fix this with this:


    const agent = request
    .agent()
    .accept('json')
    .use(() => {
    console.error('called_use');
    called++;
    })
    .once('request', () => {
    console.error('called_request');
    event_called++;
    })
    // DISABLED HERE
    // .query({ hello: 'world' })
    .set('X-test', 'testing');

    return agent
    .get(`${base}/echo`)
    // ADDED HERE
    .query({ hello: 'world' })
    .then((res) => {
    assert.equal(1, called);
    assert.equal(1, event_called);
    assert.equal('application/json', res.headers.accept);
    assert.equal('testing', res.headers['x-test']);

    return agent.get(`${base}/querystring`)
    // ADDED HERE ALSO
    .query({hello:'world'});
    })
    .then((res) => {
    assert.equal(2, called);
    assert.equal(2, event_called);
    assert.deepEqual({ hello: 'world' }, res.body);
    });

    but then it proves the reverse than wanted: 'should remember defaults' becomes 'no rememebr default' or 'unable to set default'

    Is there a change in Nodejs "http" object ?


    Yes, there is. This returns a new QUERY method now.
    I'm doing a patch right now.

    <div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">Le dim. 6 juil. 2025 à 08:13, Yadd &lt;<a href="mailto:[email protected]">[email protected]</a>&gt; a écrit :<br></div><
    blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 7/5/25 15:32, Paul Gevers wrote:<br>
    &gt; Source: node-superagent<br>
    &gt; Version: 9.0.1-1<br>
    &gt; Severity: serious<br>
    &gt; User: <a href="mailto:[email protected]" target="_blank">[email protected]</a><br>
    &gt; Usertags: regression<br>
    &gt; <br>
    &gt; Dear maintainer(s),<br>
    &gt; <br>
    &gt; Your package has an autopkgtest, great. However, it fails since June <br> &gt; 2025. Can you please investigate the situation and fix it? I copied some <br>
    &gt; of the output at the bottom of this report.<br>
    &gt; <br>
    &gt; The release team has announced [1] that failing autopkgtest on amd64 and <br>
    &gt; arm64 are considered RC in testing.<br>
    &gt; <br>
    &gt; More information about this bug and the reason for filing it can be <br> &gt; found on <a href="https://wiki.debian.org/ContinuousIntegration/" rel="noreferrer" target="_blank">https://wiki.debian.org/ContinuousIntegration/</a> <br>
    &gt; RegressionEmailInformation<br>
    &gt; <br>
    &gt; With my Release Team member hat on I allow you to tag this bug as <br> &gt; trixie-ignore if this is nearly completely a test issue as it&#39;s so late <br>
    &gt; in the freeze and it&#39;s not worth removing the package from trixie <br> &gt; because of a failing test at this moment unless it exposes a much bigger <br>
    &gt; issue. Having said that, if this is a test only issue and a fix is <br> &gt; possible without fully removing the autopkgtest and without making the <br>
    &gt; test superficial, it&#39;s still welcome, but it would need to happen soon.<br>
    &gt; <br>
    &gt; Paul<br>
    &gt; <br>
    &gt; [1] <a href="https://lists.debian.org/debian-devel-announce/2019/07/msg00002.html" rel="noreferrer" target="_blank">https://lists.debian.org/debian-devel-announce/2019/07/msg00002.html</a><br>
    &gt; <br>
    &gt; <a href="https://ci.debian.net/data/autopkgtest/testing/amd64/n/node-" rel="noreferrer" target="_blank">https://ci.debian.net/data/autopkgtest/testing/amd64/n/node-</a> <br>
    &gt; superagent/62133275/log.gz<br>
    &gt; <br>
    &gt; 105s   1) Agent<br>
    &gt; 105s        should remember defaults:<br>
    &gt; 105s<br>
    &gt; 105s       AssertionError [ERR_ASSERTION]: 0 == 1<br>
    &gt; 105s       + expected - actual<br>
    &gt; 105s<br>
    &gt; 105s       -0<br>
    &gt; 105s       +1<br>
    &gt; 105s<br>
    &gt; 105s       at Context.&lt;anonymous&gt; (test/agent-base.js:33:12)<br>
    &gt; 105s       at callFn (/usr/share/nodejs/mocha/lib/runnable.js:364:21)<br>
    &gt; 105s       at Runnable.run (/usr/share/nodejs/mocha/lib/runnable.js:352:5)<br>
    &gt; 105s       at Runner.runTest (/usr/share/nodejs/mocha/lib/runner.js:677:10)<br>
    &gt; 105s       at /usr/share/nodejs/mocha/lib/runner.js:800:12<br>
    &gt; 105s       at next (/usr/share/nodejs/mocha/lib/runner.js:592:14)<br>
    &gt; 105s       at /usr/share/nodejs/mocha/lib/runner.js:602:7<br>
    &gt; 105s       at next (/usr/share/nodejs/mocha/lib/runner.js:485:14)<br>
    &gt; 105s       at Immediate._onImmediate (/usr/share/nodejs/mocha/lib/ <br>
    &gt; runner.js:570:5)<br>
    &gt; 105s       at process.processImmediate (node:internal/timers:483:21)<br>
    &gt; 105s<br>
    &gt; 105s<br>
    &gt; 105s<br>
    &gt; 105s autopkgtest [13:05:26]: test pkg-js-autopkgtest: <br>
    &gt; -----------------------]<br>
    Hi Jérémy,<br>

    the broken test is test/agent-base.js, even with more recent <br> node-superagent and a &quot;npm instll&quot;, test still fail.<br>

    The problem is that the initialization of &quot;agent&quot; return undefined when <br>
    &quot;.query({ hello: &#39;world&#39; })&quot; is set. I can fix this with this:<br>


         const agent = request<br>
           .agent()<br>
           .accept(&#39;json&#39;)<br>
           .use(() =&gt; {<br>
             console.error(&#39;called_use&#39;);<br>
             called++;<br>
           })<br>
           .once(&#39;request&#39;, () =&gt; {<br>
             console.error(&#39;called_request&#39;);<br>
             event_called++;<br>
           })<br>
       //  DISABLED HERE<br>
       //  .query({ hello: &#39;world&#39; })<br>
           .set(&#39;X-test&#39;, &#39;testing&#39;);<br>

         return agent<br>
           .get(`${base}/echo`)<br>
       //  ADDED HERE<br>
           .query({ hello: &#39;world&#39; })<br>
           .then((res) =&gt; {<br>
             assert.equal(1, called);<br>
             assert.equal(1, event_called);<br>
             assert.equal(&#39;application/json&#39;, res.headers.accept);<br>          assert.equal(&#39;testing&#39;, res.headers[&#39;x-test&#39;]);<br>

             return agent.get(`${base}/querystring`)<br>
       //  ADDED HERE ALSO<br>
               .query({hello:&#39;world&#39;});<br>
           })<br>
           .then((res) =&gt; {<br>
             assert.equal(2, called);<br>
             assert.equal(2, event_called);<br>
             assert.deepEqual({ hello: &#39;world&#39; }, res.body);<br>
           });<br>

    but then it proves the reverse than wanted: &#39;should remember defaults&#39; <br>
    becomes &#39;no rememebr default&#39; or &#39;unable to set default&#39;<br>

    Is there a change in Nodejs &quot;http&quot; object ?<br></blockquote><div><br></div><div>Yes, there is. This returns a new QUERY method now.</div><div>I&#39;m doing a patch right now.</div><div><br></div></div></div>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)