Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

localPort and localAdress can undefined #55965

Merged
merged 1 commit into from Oct 21, 2021
Merged

localPort and localAdress can undefined #55965

merged 1 commit into from Oct 21, 2021

Conversation

ghost
Copy link

@ghost ghost commented Sep 24, 2021

Please fill in this template.

Select one of these and delete the others:

If adding a new definition:

  • The package does not already provide its own types, or cannot have its .d.ts files generated via --declaration
  • If this is for an npm package, match the name. If not, do not conflict with the name of an npm package.
  • Create it with dts-gen --dt, not by basing it on an existing project.
  • Represents shape of module/library correctly
  • tslint.json should contain { "extends": "dtslint/dt.json" }, and no additional rules.
  • tsconfig.json should have noImplicitAny, noImplicitThis, strictNullChecks, and strictFunctionTypes set to true.

If changing an existing definition:

  • Provide a URL to documentation or source code which provides context for the suggested changes: docs. The documentation does not say that it can contain undefined. But my experiments have shown what it can.
  • If this PR brings the type definitions up to date with a new version of the JS library, update the version number in the header.

If removing a declaration:

  • If a package was never on Definitely Typed, you don't need to do anything. (If you wrote a package and provided types, you don't need to register it with us.)
  • Delete the package's directory.
  • Add it to notNeededPackages.json.

@ghost ghost requested a review from peterblazejewicz as a code owner September 24, 2021 11:35
@typescript-bot
Copy link
Contributor

typescript-bot commented Sep 24, 2021

@Vector1dev Thank you for submitting this PR! I see this is your first time submitting to DefinitelyTyped 👋 — I'm the local bot who will help you through the process of getting things through.

This is a live comment which I will keep updated.

1 package in this PR

Code Reviews

Because this is a widely-used package, a DT maintainer will need to review it before it can be merged.

You can test the changes of this PR in the Playground.

Status

  • ✅ No merge conflicts
  • ✅ Continuous integration tests have passed
  • 🕐 Only a DT maintainer can approve changes without tests

Once every item on this list is checked, I'll ask you for permission to merge and publish the changes.


Diagnostic Information: What the bot saw about this PR
{
  "type": "info",
  "now": "-",
  "pr_number": 55965,
  "author": "Vector1dev",
  "headCommitOid": "70789ad0fd04ea6c2c9c7e8de2898d112b9216e2",
  "lastPushDate": "2021-09-24T11:29:57.000Z",
  "lastActivityDate": "2021-10-21T08:39:03.000Z",
  "hasMergeConflict": false,
  "isFirstContribution": true,
  "tooManyFiles": false,
  "popularityLevel": "Critical",
  "pkgInfo": [
    {
      "name": "node",
      "kind": "edit",
      "files": [
        {
          "path": "types/node/net.d.ts",
          "kind": "definition"
        }
      ],
      "owners": [
        "Microsoft",
        "DefinitelyTyped",
        "jkomyno",
        "alvis",
        "r3nya",
        "btoueg",
        "smac89",
        "touffy",
        "DeividasBakanas",
        "eyqs",
        "Hannes-Magnusson-CK",
        "hoo29",
        "kjin",
        "ajafff",
        "islishude",
        "mwiktorczyk",
        "mohsen1",
        "n-e",
        "galkin",
        "parambirs",
        "eps1lon",
        "SimonSchick",
        "ThomasdenH",
        "WilcoBakker",
        "wwwy3y3",
        "samuela",
        "kuehlein",
        "bhongy",
        "chyzwar",
        "trivikr",
        "nguymin4",
        "yoursunny",
        "qwelias",
        "ExE-Boss",
        "Ryan-Willpower",
        "peterblazejewicz",
        "addaleax",
        "victorperin",
        "ZYSzys",
        "NodeJS",
        "LinusU",
        "wafuwafu13"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Critical"
    }
  ],
  "reviews": [
    {
      "type": "approved",
      "reviewer": "LinusU",
      "date": "2021-10-21T08:39:03.000Z",
      "isMaintainer": false
    },
    {
      "type": "changereq",
      "reviewer": "weswigham",
      "date": "2021-09-25T00:51:26.000Z"
    }
  ],
  "mainBotCommentID": 926556367,
  "ciResult": "pass"
}

@typescript-bot typescript-bot added Critical package Untested Change This PR does not touch tests labels Sep 24, 2021
@typescript-bot typescript-bot added this to Waiting for Code Reviews in New Pull Request Status Board Sep 24, 2021
@typescript-bot typescript-bot moved this from Waiting for Code Reviews to Needs Maintainer Review in New Pull Request Status Board Sep 24, 2021
Copy link
Contributor

@weswigham weswigham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docs linked don't indicate the value can be undefined, and I don't know any examples when they are offhand - can you provide such an example? (And maybe also make a PR to the node docs?)

@typescript-bot typescript-bot added the Revision needed This PR needs code changes before it can be merged. label Sep 25, 2021
@typescript-bot typescript-bot moved this from Needs Maintainer Review to Needs Author Action in New Pull Request Status Board Sep 25, 2021
@typescript-bot
Copy link
Contributor

@Vector1dev One or more reviewers has requested changes. Please address their comments. I'll be back once they sign off or you've pushed new commits. Thank you!

@ghost
Copy link
Author

ghost commented Sep 25, 2021

@weswigham Yes I can provide an example. This happens when using Unix Socket.

let net = require('net');

let unixServer = net.createServer(function(client) {
    console.log(client.localPort, client.localAddress); // Prints "undefined undefined"
});
unixServer.listen('sock'); 

setTimeout(() => {
    net.createConnection("sock");
}, 200);

@peterblazejewicz
Copy link
Member

peterblazejewicz commented Sep 25, 2021

It also happens before actual underlying transport has been created (that is before connect``, createServer`, etc is used). am I right? factory methods should return initialized connection, but when creating sockets directly via constructor, that's a case.

@typescript-bot
Copy link
Contributor

@Vector1dev I haven't seen any activity on this PR in more than three weeks, and it still has problems that prevent it from being merged. The PR will be closed on Oct 25th (in a week) if the issues aren't addressed.

@typescript-bot typescript-bot added the Abandoned This PR had no activity for a long time, and is considered abandoned label Oct 18, 2021
@ghost
Copy link
Author

ghost commented Oct 20, 2021

@petebeegle Yes

@typescript-bot typescript-bot removed the Abandoned This PR had no activity for a long time, and is considered abandoned label Oct 20, 2021
Copy link
Contributor

@LinusU LinusU left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docs linked don't indicate the value can be undefined, [...]

I think that the Node.js documentation usually doesn't document nullability of values, which is a bit unfortunate 🤔

Yes I can provide an example. This happens when using Unix Socket.

Tested the example myself and it does indeed print undefined, undefined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Critical package Revision needed This PR needs code changes before it can be merged. Untested Change This PR does not touch tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants