sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: TypeScript
Issue: Reverse mapped types don't use their constraint types when no candidates are present unlike the regular type parameters
Labels: Possible Improvement

### 🔎 Search Terms

reverse mapped constraint inference candidates

### 🕗 Version & Regression Information

- This is the behavior in every version I tried

### ⏯ Playground Link

https://www.typescriptlang.org/play?ts=5.3.0-dev.20231028#code/JYOwLgpgTgZghgYwgAgApynAthSVgBeEAJgPIBGAVhAmMgN4BQyyYAngA4QBcyAzmHwgA5gG5myDhmx8A-LwBKNAPZRiAHgFDhAGmQBXEAGsQygO4gAfOIC+jRsRoAbDChiHawZSH659HdQkAFQBhb0gADzAdYIBxfQxiPmQIKIgQJOQlBFUNLVBdNGkcPEISCmpaAG0AIilMLD4agF1kAB8DDIgYUBJLGMsACgB9XiYWdi4+MYkWHPBUsF5Q8MXxFht15GEEtWmGWeQqgGlkUGQjCDZlGGQg+MS+Zt5B+cilu7CFqL16mWWHnsTs0AJTIAC8lmQADdlMBiFtNowbCCAbskuJGPMBMgoBA+PonHRwb4wP5BuNWJx8TMWHNVlFaXT6YYPgBGAAMHJizJsPOQfIkO0eTLmAAsaEYAGLKZQvYZ6ejIGCygVjZWy3j5EQCsGQjXKCHgkk1FXKGr8lhwJxmOBsPhBKD6HjIEZ6qGCZ38wUozF4glE8QAeiDyAAerJ7IwgA

### 💻 Code

```ts
interface ParameterizedObject {
  type: string;
  params?: Record<string, unknown>;
}

declare function setup<
  TContext,
  TGuards extends Record<string, ParameterizedObject["params"] | undefined>,
>(_: {
  types: {
    context: TContext;
  };
  guards: {
    [K in keyof TGuards]: (context: TContext, params: TGuards[K]) => void;
  };
}): TGuards;

const result = setup({
  types: {
    context: {
      count: 100,
    },
  },
  guards: {
    checkFoo: (_, { foo }: { foo: string }) => foo === "foo",
    alwaysTrue: (_) => true,
  },
});

result;
// ^?
```


### 🙁 Actual behavior

```
Type '(_: { count: number; }, { foo }: { foo: string; }) => boolean' is not assignable to type '(context: { count: number; }, params: Record<string, unknown> | undefined) => void'.
  Types of parameters '__1' and 'params' are incompatible.
    Type 'Record<string, unknown> | undefined' is not assignable to type '{ foo: string; }'.
      Type 'undefined' is not assignable to type '{ foo: string; }'.(2322)
```

### 🙂 Expected behavior

I'd expect the inference to succeed here

### Additional information about the issue

`TGuards` is inferred as `{ checkFoo: { foo: string; }; alwaysTrue: unknown; }` and thus rejected by the constraint check in `getInferredType`. `alwaysTrue` is inferred as `unknown` because `inferReverseMappedType` has such a return:
```ts
return getTypeFromInference(inference) || unknownType
```

And `getTypeFromInference` doesn't attempt to read the type parameter's constraint at all. It simply handles `.candidates` and `.contraCandidates` and that's it.
Repository: godot
Issue: Raycasts clips through edges/corners
Labels: topic:physics,needs testing,topic:3d

### Godot version

4.1 .Net

### System information

Win10 22H2 x64

### Issue description

When raycasting, raycasting fails to detect anything when the ray originates near an intersection of two meshes.

For example, a wall and a floor. If the ray originates near where the wall and floor meet, and the ray is supposed to detect hitting the wall, it will actually just skip through the wall and not detect anything.

### Steps to reproduce

1) Create a cube room where each floor, ceiling, and wall are separate meshes.
2) Make code that constantly runs a raycast, where each new ray starts from hit position of the previous ray.
3) Observe that the last ray created always stops at a point near the intersection/edge of the room.

### Minimal reproduction project

MRP here: https://filebin.net/48o46mknm5pvky6o
Game.cs is the script, and the only relevant functions for this MRP are `testRaycast()` and `DrawLine()`.

Scene breakdown:
1) The camera is placed inside a watertight room, and attached to the camera is an empty Node3D.
2) When game runs, there is a counter that counts up by 1. 
3) When counter ==1, the empty Node3D is randomly rotated. The forward vector of this Node3D is used to determine the direction of the initial raycast.
4) The origin of the ray and the hit point of the ray is recorded.
5) Raycast continues to bounce/propagate, where each new ray begins from the hit point of the previous ray.

Use WASD to move the camera. Rays are colored red to show successful bounced raycasts. Green is used to show the line that SHOULD have been produced if the raycast successfully detected the next obstacle. You will want to move the camera outside the walls to see the green line, and trace it back to the its origin.

Now, remember the camera is inside a WATERTIGHT room. This means there should be NO WAY for the raycast to escape, and should bounce infinitely until the application closes. However, you will notice after a few seconds at most, that the raycast will eventually escape the room. The condition I found for the ray escape is that the ray must start near the intersection of two walls/floors. I guess the step size for the raycast is too large to detect a small distance between ray origin and physically-accurate hit point?

I have tried using box meshes in the CollisionShape nodes, and I have also used MeshColliders as well (MRP uses MeshColliders). None have resolved.

I've also tried running testRaycast() from PhysicsProcess() instead of Process(), also did not resolve.

I also tried using Godot Jolt, and it did not resolve either. In fact, Godot Jolt failed after the first raycast in all my tests...
Repository: node
Issue: node：internal/url getpathfromurlwin32(url)
Labels: url,security

### Version

v18.12.0

### Platform

Microsoft Windows NT 10.0.22621.0 x64

### Subsystem

url

### What steps will reproduce the bug?

On networked filesystems on Windows, the getpathfromurlwin32()  function in the URL is used.
Where getpathfromurlwin32() functions are used, pass in a malicious parameter，there may be vulnerabilities, such as file reads
`return isWindows ? getPathFromURLWin32(path) : getPathFromURLPosix(path);`


### How often does it reproduce? Is there a required condition?

The code provided will reproduce this issue every time on Windows

### What is the expected behavior? Why is that the expected behavior?

_No response_

### What do you see instead?

```js
function getPathFromURLWin32(url) {
  const hostname = url.hostname;
  let pathname = url.pathname;
  for (let n = 0; n < pathname.length; n++) {
    if (pathname[n] === '%') {
      const third = pathname.codePointAt(n + 2) | 0x20;
      if ((pathname[n + 1] === '2' && third === 102) || // 2f 2F /
          (pathname[n + 1] === '5' && third === 99)) {  // 5c 5C \
        throw new ERR_INVALID_FILE_URL_PATH(
          'must not include encoded \\ or / characters'
        );
      }
    }
  }
  pathname = StringPrototypeReplaceAll(pathname, '/', '\\');
  pathname = decodeURIComponent(pathname);
  if (hostname !== '') {
 decoded.
    return `\\\\${domainToUnicode(hostname)}${pathname}`;
  }
  // Otherwise, it's a local path that requires a drive letter
  const letter = pathname.codePointAt(1) | 0x20;
  const sep = pathname[2];
  if (letter < CHAR_LOWERCASE_A || letter > CHAR_LOWERCASE_Z ||   // a..z A..Z
      (sep !== ':')) {
    throw new ERR_INVALID_FILE_URL_PATH('must be absolute');
  }
  return pathname.slice(1);
}
```

在这个函数下，当我传入参数值为`%20E://fl%2561g.txt`,那么我可以成功读取文件

### Additional information

_No response_
Repository: pytorch
Issue: IBM AfroHacks at AfroTech Participation
Labels: triaged

### 🚀 The feature, motivation and pitch

IBM AfroHacks at AfroTech Hackathon starts on Monday, and we would love to drive contributions to the PyTorch project repo(s), but they are not properly labeled for participants wanting to contribute to PyTorch during the 2-day hackathon which projects/issues to work on. 

Add “afrohacks” to Settings => Topics on any PyTorch repos, and add "afrohacks" to issue Labels, to indicate the repos/repo issues PyTorch would like to have participants work on during the 48-hour AfroHacks at AfroTech Hackathon starting on Monday. Please feel free to connect with me with any questions. Thank you!

### Alternatives

_No response_

### Additional context

_No response_
Repository: deno
Issue: Test runner does not wait for web worker to terminate
Labels: bug,needs investigation,testing

## Summary

test runners do not wait for web workers to terminate.

## Minimal reproduction

```ts
// a.ts
setTimeout(() => console.log("hello"), 1000)
```

```ts
// a_test.ts
const foo = () => {
	const worker = new Worker(new URL("./a.ts", import.meta.url), { type: "module" })

	return new Promise(() => worker.terminate())
}

Deno.test("wait for worker", async () => {
    console.log("begin")
	await foo()
    console.log("end")
})
```

## Actual behavior

```
running 1 test from ./a_test.ts
wait for worser ...
------- output -------
begin
Check file:///home/scarf/repo/w1-social-feed/a.ts

ok | 0 passed | 0 failed (110ms)

error: Promise resolution is still pending but the event loop has already resolved.
```

## System Info
```
deno 1.37.2+8f065a6 (canary, x86_64-unknown-linux-gnu)
v8 11.8.172.13
typescript 5.2.2
Ubuntu 23.04
```
Repository: deno
Issue: Significant perf gains possible on simple "create object and serialize" task?
Labels: perf,upstream,needs investigation

While investigating a problem on one of my production servers (where, in case you're curious, an operation wasn't completing in time after a SIGINT, resulting in a SIGKILL by `pm2`), I eventually ended up with this micro-benchmark:
```js
let t = performance.now();

let obj = {};
for(let i = 0; i < 5000000; i++) {
  obj[i] = Math.random();
}

console.log("time to make obj:", performance.now() - t);

t = performance.now();

let str = "";
for(let key in obj) {
  str += `${key}: ${obj[key]}\n`;
}

console.log("time to make str:", performance.now() - t);
```
```
bun main.js
deno run main.js
```
Bun is ~10x faster at making `obj`, and ~1.5x faster at making `str`. If I change `Math.random()` to `"aaaaaaaaaaaaaa"`, then Bun is only ~5x faster at making `obj`.

I also tried `"aaaaaaaaaaaaaa😊"` in case it was somehow related to (lack of) [Latin-1](https://github.com/denoland/deno/issues/20409) optimizations, but that didn't affect the scores.

In Chrome (I only tested v118), making `obj` is ~10x slower, but making `str` is about the same speed as in Bun, weirdly.

This isn't a huge deal for me (unlike #20409 and #20428 and especially #20355), so I don't want to risk drawing dev hours away from more important things, but it is an actual issue I had in production, so I figured it'd be a shame not to share it.

Please close if this is better filed on crbug.
Repository: godot
Issue: SpotLight3D soft shadow sharpness depends on range
Labels: bug,topic:rendering,topic:3d

### Godot version

4.2 beta 3 (also 4.1.2 stable and 4.0.4 stable)

### System information

Godot v4.2.beta3 - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3060 Ti (NVIDIA; 31.0.15.3758) - AMD Ryzen 7 3700X 8-Core Processor (16 Threads)

### Issue description

As the range increases the shadow gets sharper, although this shouldn't depend on the range of the light.
Light size: 0,5m
Low range (few meters): 
![grafik](https://github.com/godotengine/godot/assets/50084500/94521731-adea-4a73-824a-186593730ce5)
High range (100 meters):
![grafik](https://github.com/godotengine/godot/assets/50084500/8241d227-ee94-431e-bfac-986c21242332)


### Steps to reproduce

Import the MRP and fiddle with the SpotLight3D's range.

### Minimal reproduction project

[light-size-mrp.zip](https://github.com/godotengine/godot/files/13196145/light-size-mrp.zip)
Repository: PowerToys
Issue: How can I properly swap the SHIFT and non-SHIFT functions of a key with Keyboard Manager?
Labels: Product-Keyboard Shortcut Manager,Needs-Triage

### Description of the new feature / enhancement

I'm using a German QWERTZ Layout and writing a ' symbol is bound to SHIFT+#. I would like to reverse this behavior so pressing the # key invokes a ' and pressing SHIFT+# actually invokes a #. The first part works easily with Keyboard Manager, however if I assign the second part then it seems the two changes cancel each other out.

Is there a way to properly handle this with Keyboard Manager?

### Scenario when this would be used?

The function would further enhance workflow optimizations with a keyboard.

### Supporting information

_No response_
Repository: node
Issue: ESLint is going to deprecate formatting rules
Labels: tools

See https://eslint.org/blog/2023/10/deprecating-formatting-rules/
Repository: PowerToys
Issue: awake feature : default when PC boots
Labels: Idea-Enhancement,Product-Awake

### Description of the new feature / enhancement

Add a setting menu to set default behavior when PC boots.
The menu includes 2 items. 
A item is to set back to the selected power plan.
Another item is to keep on user switched state. ex;  ** Keep awake on interval** and so on.

### Scenario when this would be used?

PREMISE: I usually use the selected power plan, and set to this default menu setting is **the slected power plan**.

I switched to **Keep awake on interval* *  when a work takes time.
The work was finished and PC was shutdown.

Awake returns to  **the slected power plan** when next PC booting.

### Supporting information

_No response_
Repository: go
Issue: net/http: TestTransportRejectsInvalidHeaders failures with `unexpected EOF`
Labels: NeedsInvestigation

```
#!watchflakes
post <- pkg == "net/http" && test == "TestTransportRejectsInvalidHeaders" && `unexpected EOF`
```

Issue created automatically to collect these failures.

Example ([log](https://build.golang.org/log/0957be7a39677705a8742291b1ae046a8f0a87d7)):

    --- FAIL: TestTransportRejectsInvalidHeaders (0.00s)
        --- FAIL: TestTransportRejectsInvalidHeaders/h2 (2.97s)
            clientserver_test.go:1230: For key "Foo", value "capital-key"; got err = Get "https://127.0.0.1:50773": unexpected EOF; want ok=true


— [watchflakes](https://go.dev/wiki/Watchflakes)
Repository: godot
Issue: EditorInterface.set_main_screen_editor doesn't work if open_scene_from_path has been called before
Labels: bug,topic:editor,needs testing

### Godot version

4.1.2.stable

### System information

Godot v4.1.2.stable - Windows 6.3.9600 - Vulkan (Forward+) - dedicated GeForce GT 1030 () - AMD Ryzen 5 3600 6-Core Processor (12 Threads)

### Issue description

When creating a plugin that adds a dock to the editor, the method `set_main_screen_editor` stops working if an scene has been previously opened with `open_scene_from_path`

PS: I don't know why Godot reports my Windows version as 6. It's 8.1

### Steps to reproduce

1) Create a plugin that adds a dock to the interface
2) Add a `Control` that triggers a function in the dock script
3) Change the main screen using `set_main_screen_editor`
4) Open a scene using `open_scene_from_path`
5) Try and change the main screen again

### Minimal reproduction project

[godot_test.zip](https://github.com/godotengine/godot/files/13196266/godot_test.zip)
Repository: neovim
Issue: remove sandbox, 'secure', 'modelineexpr'
Labels: enhancement,refactor,compatibility

### Problem

Is sandbox or "restricted mode" actually doing anything useful? The need for a pseudo "secure" mode is outdated since:

1. 'modeline' no longer allows expressions (unless 'modelineexpr' is set, but we could remove that in favor of 'exrc')
2. 'exrc' has per-directory opt-in (`:trust`)

Use cases for sandbox:

- vimgolf? https://github.com/neovim/neovim/issues/11972#issuecomment-757536989

Previous:

- https://github.com/neovim/neovim/issues/11972

### Expected behavior

- Remove 'secure' option.
- Remove 'modelineexpr' option.
- Remove "sandbox" concept and `:sandbox` command.
- Remove `check_secure` function.
Repository: deno
Issue: Local KV: `set` with non-positive `expireIn` should not persist the value
Labels: ext/kv

To reproduce:

```ts
const kv = await Deno.openKv();
await kv.set([ 'e' ], 'e', { expireIn: -1 }); // or 0, or -1000 etc
assertEquals((await kv.get([ 'e' ])).value, null); // fails!
```

Currently, the value is persisted!  Even if the cleanup process is async, this seems like a situation where the value should not be stored in the first place.

```sh
$ deno --version
deno 1.37.2 (release, aarch64-apple-darwin)
v8 11.8.172.13
typescript 5.2.2
```
Repository: godot
Issue: GPU Particles lacks unit info on Directional and Radial animated velocities
Labels: enhancement,documentation,topic:particles

### Godot version

v4.2.beta3

### System information

Godot v4.2.beta3 - Windows 10.0.19045 - Vulkan (Forward+, Mobile) - GLES3 (Compatibility) - dedicated NVIDIA GeForce GTX 1650 (NVIDIA; 31.0.15.4592) - Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz (8 Threads)

### Issue description

The ParticleProcessMaterial, that deals with GPU Particles, lacks documentation for the units used in Directional and Radial animated velocities.

Based on the MRP, they both use distance per second.

![animated properties](https://github.com/godotengine/godot/assets/16827309/e843c286-3860-49ed-af4a-cc536cbd8e39)


### Steps to reproduce

The MRP has "main_2d" and "main_3d" scenes that show the particles' movement for 1 second.
- 2D : 100 units
- 3D : 10 units

### Minimal reproduction project

[GPUParticles Directional and Radial.zip](https://github.com/godotengine/godot/files/13196419/GPUParticles.Directional.and.Radial.zip)
Repository: ollama
Issue: `digest mismatch` on download
Labels: bug

While rare, `ollama pull` will sometimes result in a digest mismatch on download

```
% ollama run wizard-vicuna-uncensored:30b-q5_K_M
pulling manifest
pulling b1571c5cbd28... 100% |█████████████████████████████████████████████████████████████████████████████████████████████████████████| (45/45 B, 34 B/s)        
pulling d14264189a8a... 100% |█████████████████████████████████████████████████████████████████████████████████████████████████████████| (31/31 B, 17 B/s)        
pulling c4c2b65331ba... 100% |██████████████████████████████████████████████████████████████████████████████████████████████████████| (384/384 B, 238 B/s)        
verifying sha256 digest

Error: digest mismatch, file must be downloaded again: want sha256:1a640cd4d69a5260bcc807a531f82ddb3890ebf49bc2a323e60a9290547135c1, got sha256:5eef5d8ec5ce977b74f91524c0002f9a7adeb61606cdbdad6460e25d58d0f454
```
Repository: godot
Issue: Cannot debug nested dictionaries
Labels: bug,topic:editor,confirmed

### Godot version

4.2.beta3

### System information

Godot v4.2.beta3 - Windows 10.0.19045 - GLES3 (Compatibility) - Intel(R) HD Graphics 4600 (Intel Corporation; 20.19.15.5126) - Intel(R) Core(TM) i3-4330 CPU @ 3.50GHz (4 Threads)

### Issue description

When I try to access dictionaries that are nested within other dictionaries using the Remote tab, glitches appear and viewing these dictionaries becomes impossible. Watch the video:

https://github.com/godotengine/godot/assets/136469511/d8ad1f64-6748-4e05-a80e-c3f6ec3831ff

Notes:
   - Dictionaries are not constantly changing, they are only initialized once at the beginning of the program
   - This also happens with nested Arrays


### Steps to reproduce

1. Add one dictionary inside another, inside another dictionary, making a total of 3
2. Run the project and look for this variable in the inspector

### Minimal reproduction project

N/A
Repository: neovim
Issue: Make z= use vim.ui.select
Labels: enhancement,spell

### Problem

It would be nice if `z=` aka spell suggestion is aware of `vim.ui.select`, right now it just uses the default implementation

### Expected behavior

`z=` uses vim.ui.select for selecting suggestions
Repository: stable-diffusion-webui
Issue: [Bug]: stable diffusion inside Docker crashes with error: ModuleNotFoundError: No module named 'pytorch_lightning.utilities.distributed'
Labels: bug-report

### Is there an existing issue for this?

- [X] I have searched the existing issues and checked the recent builds/commits

### What happened?

I tried to use the rocm/pytorch Docker image but when starting stable-diffusion-webui following the install instructions i get the following error:  ModuleNotFoundError: No module named 'pytorch_lightning.utilities.distributed'

I tried downgrading to pytorch_lightning v1.7.7 and 1.6.5 but with no effect

Has anyone else this problem and know a solution?

### Steps to reproduce the problem

1. Install stable-diffusion-webui with Docker


### What should have happened?

webui should have started without error

### Sysinfo

Linux Mint 20.1 Ulyssa
RX 580

### What browsers do you use to access the UI ?

_No response_

### Console logs

```Shell
Python 3.9.5 (default, Nov 23 2021, 15:27:38) 
[GCC 9.3.0]
Version: v1.6.0
Commit hash: 5ef669de080814067961f28357256e8fe27544f4
Launching Web UI with arguments: --precision full --no-half --skip-torch-cuda-test
no module 'xformers'. Processing without...
no module 'xformers'. Processing without...
Traceback (most recent call last):
  File "/dockerx/stable-diffusion-webui/launch.py", line 48, in <module>
    main()
  File "/dockerx/stable-diffusion-webui/launch.py", line 44, in main
    start()
  File "/dockerx/stable-diffusion-webui/modules/launch_utils.py", line 432, in start
    import webui
  File "/dockerx/stable-diffusion-webui/webui.py", line 13, in <module>
    initialize.imports()
  File "/dockerx/stable-diffusion-webui/modules/initialize.py", line 33, in imports
    from modules import shared_init
  File "/dockerx/stable-diffusion-webui/modules/shared_init.py", line 5, in <module>
    from modules import shared
  File "/dockerx/stable-diffusion-webui/modules/shared.py", line 5, in <module>
    from modules import shared_cmd_options, shared_gradio_themes, options, shared_items, sd_models_types
  File "/dockerx/stable-diffusion-webui/modules/sd_models_types.py", line 1, in <module>
    from ldm.models.diffusion.ddpm import LatentDiffusion
  File "/dockerx/stable-diffusion-webui/repositories/stable-diffusion-stability-ai/ldm/models/diffusion/ddpm.py", line 20, in <module>
    from pytorch_lightning.utilities.distributed import rank_zero_only
ModuleNotFoundError: No module named 'pytorch_lightning.utilities.distributed'
```


### Additional information

_No response_
Repository: PowerToys
Issue: MWB: Mouse Only / Ignore Keyboard Sync Option
Labels: Needs-Triage,Product-Mouse Without Borders

### Description of the new feature / enhancement

Under the Activation section, toggle switches for:
Link Mouse <on/off>
Link Keyboard <on/off>

### Scenario when this would be used?

Live event production: multiple laptops each with various attached Xkeys / StreamDeck controllers triggering multiple hardware devices.

Currently, I need to remember to give the correct laptop focus via the mouse before I hit one of the triggers, which is error prone.

There are times when programming where having all 4 computers share common mouse / keyboard inputs is useful, but during performances having a single mouse / separate keyboards is ideal. The ability to change that behaviour on each machine individually via a toggle switch would be ideal.

Thanks for considering this request.

### Supporting information

https://answers.microsoft.com/en-us/windows/forum/all/mouse-without-borders-without-keyboard-sharing/d284051c-4e07-4d6a-be4e-da12865ffe0d