Skip to content

Conversation

@xandris
Copy link
Contributor

@xandris xandris commented Dec 15, 2020

If all subpaths of the given path already exist, the result is not EEXIST like the non-recursive case, but undefined. The callback is called like cb(null), not cb(null, undefined).

I'm a little concerned this is undefined behavior because the API documentation doesn't say what's supposed to happen if all path components already exist, other than that it isn't considered an error like the non-recursive case. But it would stand to reason that if it's not an error, and no directory was created, then the "first directory created" is literally undefined.

But even though the official API docs don't mention it, you can't in practice rely on the return value to be defined. I believe type definitions shouldn't incorporate implementation bugs, but I also don't believe this is an implementation bug, just a documentation oversight.

This seems like the only reasonable definition given the circumstances; that is, if the Node developers eventually address this edge case, I struggle to see what the alternative would be.

Please fill in this template.

Select one of these and delete the others:

If changing an existing definition:

If all subpaths of the given path already exist, the result is not
EEXIST like the non-recursive case, but undefined. The callback receives
only one argument (the Error, null).
@typescript-bot
Copy link
Contributor

typescript-bot commented Dec 15, 2020

@xandris 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.

Status

  • ✅ No merge conflicts
  • ❌ Continuous integration tests have passed
  • ❌ Most recent commit is approved by a DT maintainer

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

Inactive

This PR has been inactive for 31 days — it is considered abandoned, and therefore closed!


Diagnostic Information: What the bot saw about this PR
{
  "type": "info",
  "now": "-",
  "pr_number": 50121,
  "author": "xandris",
  "headCommitOid": "62ba73d42dae0ed8b893ad42ac70509a14c598f6",
  "lastPushDate": "2020-12-15T01:09:57.000Z",
  "lastActivityDate": "2020-12-15T09:57:52.000Z",
  "maintainerBlessed": false,
  "hasMergeConflict": false,
  "isFirstContribution": true,
  "popularityLevel": "Critical",
  "pkgInfo": [
    {
      "name": "node",
      "kind": "edit",
      "files": [
        {
          "path": "types/node/fs.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/fs/promises.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/test/fs.ts",
          "kind": "test"
        },
        {
          "path": "types/node/v13/fs.d.ts",
          "kind": "definition"
        }
      ],
      "owners": [
        "Microsoft",
        "DefinitelyTyped",
        "jkomyno",
        "a-tarasyuk",
        "alvis",
        "r3nya",
        "btoueg",
        "brunoscheufler",
        "smac89",
        "touffy",
        "DeividasBakanas",
        "eyqs",
        "Flarna",
        "Hannes-Magnusson-CK",
        "KSXGitHub",
        "hoo29",
        "kjin",
        "ajafff",
        "islishude",
        "mwiktorczyk",
        "mohsen1",
        "n-e",
        "galkin",
        "parambirs",
        "eps1lon",
        "SimonSchick",
        "ThomasdenH",
        "WilcoBakker",
        "wwwy3y3",
        "samuela",
        "kuehlein",
        "j-oliveras",
        "bhongy",
        "chyzwar",
        "trivikr",
        "nguymin4",
        "yoursunny",
        "qwelias",
        "ExE-Boss",
        "Ryan-Willpower",
        "peterblazejewicz",
        "addaleax",
        "JasonHK",
        "victorperin",
        "ZYSzys"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Critical"
    }
  ],
  "reviews": [
    {
      "type": "approved",
      "reviewer": "a-tarasyuk",
      "date": "2020-12-15T09:57:52.000Z",
      "isMaintainer": false
    },
    {
      "type": "approved",
      "reviewer": "Flarna",
      "date": "2020-12-15T09:56:36.000Z",
      "isMaintainer": false
    }
  ],
  "ciResult": "fail",
  "ciUrl": "https://github.com/DefinitelyTyped/DefinitelyTyped/commit/62ba73d42dae0ed8b893ad42ac70509a14c598f6/checks?check_suite_id=1668690392"
}

@typescript-bot
Copy link
Contributor

👋 Hi there! I’ve run some quick measurements against master and your PR. These metrics should help the humans reviewing this PR gauge whether it might negatively affect compile times or editor responsiveness for users who install these typings.

Let’s review the numbers, shall we?

node/v14.14

Comparison details for node/14.14 📊
master #50121 diff
Batch compilation
Memory usage (MiB) 108.7 112.8 +3.8%
Type count 17683 17683 0%
Assignability cache size 5062 5062 0%
Language service
Samples taken 28 28 0%
Identifiers in tests 28 28 0%
getCompletionsAtPosition
    Mean duration (ms) 563.2 594.6 +5.6%
    Mean CV 9.4% 10.8%
    Worst duration (ms) 662.0 721.8 +9.0%
    Worst identifier instance instance
getQuickInfoAtPosition
    Mean duration (ms) 565.7 570.8 +0.9%
    Mean CV 10.9% 8.5%
    Worst duration (ms) 604.7 642.6 +6.3%
    Worst identifier wasi preopens

It looks like nothing changed too much. I won’t post performance data again unless it gets worse.

node/v14.14

Comparison details for node/14.14 📊
master #50121 diff
Batch compilation
Memory usage (MiB) 109.6 103.6 -5.5%
Type count 17683 17683 0%
Assignability cache size 5062 5062 0%
Language service
Samples taken 28 28 0%
Identifiers in tests 28 28 0%
getCompletionsAtPosition
    Mean duration (ms) 604.3 564.6 -6.6%
    Mean CV 9.9% 10.7%
    Worst duration (ms) 687.3 687.9 +0.1%
    Worst identifier importObject preopens
getQuickInfoAtPosition
    Mean duration (ms) 606.6 565.3 -6.8%
    Mean CV 9.2% 10.3%
    Worst duration (ms) 697.3 637.3 -8.6%
    Worst identifier wasm env

It looks like nothing changed too much. I won’t post performance data again unless it gets worse.

@typescript-bot typescript-bot added Perf: Same typescript-bot determined that this PR will not significantly impact compilation performance. The CI failed When GH Actions fails labels Dec 15, 2020
@typescript-bot
Copy link
Contributor

@xandris The CI build failed! Please review the logs for more information.

Once you've pushed the fixes, the build will automatically re-run. Thanks!

@typescript-bot typescript-bot added the Owner Approved A listed owner of this package signed off on the pull request. label Dec 15, 2020
@typescript-bot typescript-bot added Where is GH Actions? GH Actions didn't give a response to this PR Unreviewed No one showed up to review this PR, so it'll be reviewed by a DT maintainer. and removed The CI failed When GH Actions fails labels Jan 4, 2021
@typescript-bot
Copy link
Contributor

@typescript-bot typescript-bot added The CI failed When GH Actions fails and removed Unreviewed No one showed up to review this PR, so it'll be reviewed by a DT maintainer. Where is GH Actions? GH Actions didn't give a response to this PR labels Jan 4, 2021
@typescript-bot typescript-bot added the Abandoned This PR had no activity for a long time, and is considered abandoned label Jan 14, 2021
@typescript-bot
Copy link
Contributor

@xandris 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 in a week if the issues aren't addressed.

@typescript-bot
Copy link
Contributor

@xandris To keep things tidy, we have to close PRs that aren't mergeable and don't have activity in the last month. No worries, though — please open a new PR if you'd like to continue with this change. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Abandoned This PR had no activity for a long time, and is considered abandoned Critical package Owner Approved A listed owner of this package signed off on the pull request. Perf: Same typescript-bot determined that this PR will not significantly impact compilation performance. The CI failed When GH Actions fails

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants