sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: react
Issue: Events before Client Side Hydration
Labels: Resolution: Backlog

Recently I detected a problem using React in SSR. Maybe is quite obvious, but all the JavaScript events that are fired before the JavaScript is loaded, are lost...

This is something normal. The JS is not there yet... Ok. However, I expect to have some utility to do some exceptions.

I'm going to try to explain my case:

I'm using an image, and in the event `onError`, I want to change the src to render a fallback image.

```jsx
function Img(props) {
  return (
    <img {...props} onError={e => { e.target.src = fallbackSrc } } />
  )
}
```

Nevertheless, this code loaded from SSR, is working "sometimes"... I guess that this "sometimes" is because if the event is fired before the client side hydration. Is not catched by my JS. And the `e => e.target.src = fallbackSrc` is never executed. However, if the JS is loaded faster than the onError event, is catched, and is rendering the fallback image as I expected.

I want to propose some utility to do sometimes some exceptions, and render the JS inline on the first render. Perhaps, adding some extra config in `ReactDOM.hydrate`? I dunno... 

Or maybe someone can help me providing any tip in order to fix this?
Repository: flutter
Issue: Make Tab widget _warpToCurrentIndex transition more robust
Labels: framework,f: material design,c: proposal,P3,team-design,triaged-design

_warpToCurrentIndex is called when you jump more than two tabs. 
During the warping, didUpdateWidget will delay until warping finish. That mean any change to the widget will be postpone during warping. We should come up a better way to do this.

This issue come up during the discussion in https://github.com/flutter/flutter/pull/29188#discussion_r276479006
Repository: go
Issue: x/tools/gopls: improve suggestions in completion placeholders
Labels: help wanted,FeatureRequest,gopls

Context: #31547.

We should suggest in-scope identifiers of the matching type when adding placeholders for a function.

We would also need to develop some heuristics to determine which identifier to suggest, if there are multiple in scope. (Ideas: most recently declared, closest name to the one declared in the function signature.)
Repository: flutter
Issue: Add more tool analytics dimensions
Labels: c: new feature,team,tool,P3,team-tool,triaged-tool

Currently, the Usage.sendTiming sends a bunch of useful dimensions to the flutter run invocations such as success/failure, target platforms etc. But timing data is sampled and sendCommand / Screens should be the primary data gathering mechanism. But we don't have any data in terms dimensions besides the flutter tools command that was run. 

Add in things like success failure, target platform.
Repository: pytorch
Issue: The `unary_kernel` call should be pushed into CopyKernel.cpp and it should completely replace the current `copy_kernel`.
Labels: module: cpu,triaged

The `unary_kernel` call should be pushed into CopyKernel.cpp and it should completely replace the current `copy_kernel`.

i.e. _copy_same_type__cpu should just be:
```
void _copy_same_type__cpu(Tensor& self, const Tensor& src) {
  if (self.is_same(src)) {
    return;
  }
  if (self.numel() == src.numel() && !(self.is_contiguous() && src.is_contiguous()) && copy_transpose_valid(self, src)) {
    _copy_same_type_transpose_(self, src);
  }
  copy_kernel(kCPU, *iter);
}
```

You should also add an extra case to `unary_kernel` to handle the case where one operand is effectively a scalar (stride 0):

`is_contiguous_s1`

Here's the corresponding case for the binary_kernel:

https://github.com/pytorch/pytorch/blob/3e0b46b6d132c22af84769a6df1ef8d1f785dbe2/aten/src/ATen/native/cpu/Loops.h#L21-L26

`is_contiguous_s1` should be the same but no check of `strides[2]` (because there are only two operands)

_Originally posted by @colesbury in https://github.com/pytorch/pytorch/pull/18618/files_
Repository: TypeScript
Issue: Removing optional modifier also removes `undefined` from value type
Labels: Bug

<!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨

Half of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker. Even if you think you've found a *bug*, please read the FAQ first, especially the Common "Bugs" That Aren't Bugs section!

Please help us by doing the following steps before logging an issue:
  * Search: https://github.com/Microsoft/TypeScript/search?type=Issues
  * Read the FAQ: https://github.com/Microsoft/TypeScript/wiki/FAQ

Please fill in the *entire* template below.
-->

<!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->
**TypeScript Version:**  3.3.3333

<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
**Search Terms:** NonPartial, remove optional modifier

**Code**

```ts
// A *self-contained* demonstration of the problem follows...
// Test this by running `tsc` on the command-line, rather than through another build tool such as Gulp, Webpack, etc.

interface OptClass {
  opt?: number;
}

type NonPartialIsh = {[K in keyof OptClass]-?: OptClass[K] | undefined};

const test = {opt: undefined};

verify<NonPartialIsh>(test);  // should NOT be error, but shows error

function verify<T>(a: T) {}
```

**Expected behavior:**
* Should not have any error.
* `NonPartialish.opt` type should support `undefined`.

**Actual behavior:**
* Throws the following error:

```
ERROR(12,23): : Argument of type '{ opt: undefined; }' is not assignable to parameter of type 'NonPartialIsh'.
  Types of property 'opt' are incompatible.
    Type 'undefined' is not assignable to type 'number'.
Transpiled code follows despite errors.
```
* `NonPartialish.opt` type does not support `undefined`.


**Playground Link:** <!-- A link to a TypeScript Playground "Share" link which demonstrates this behavior --> https://www.typescriptlang.org/play/#src=%2F%2F%20A%20*self-contained*%20demonstration%20of%20the%20problem%20follows...%0D%0A%2F%2F%20Test%20this%20by%20running%20%60tsc%60%20on%20the%20command-line%2C%20rather%20than%20through%20another%20build%20tool%20such%20as%20Gulp%2C%20Webpack%2C%20etc.%0D%0A%0D%0Ainterface%20OptClass%20%7B%0D%0A%20%20opt%3F%3A%20number%3B%0D%0A%7D%0D%0A%0D%0Atype%20NonPartialIsh%20%3D%20%7B%5BK%20in%20keyof%20OptClass%5D-%3F%3A%20OptClass%5BK%5D%20%7C%20undefined%7D%3B%0D%0A%0D%0Aconst%20test%20%3D%20%7Bopt%3A%20undefined%7D%3B%0D%0A%0D%0Averify%3CNonPartialIsh%3E(test)%3B%20%20%2F%2F%20should%20NOT%20be%20error%2C%20but%20shows%20error%0D%0A%0D%0Afunction%20verify%3CT%3E(a%3A%20T)%20%7B%20%7D%0D%0A

**Related Issues:** <!-- Did you find other bugs that looked similar? -->
Repository: go
Issue: net/http: roundtrip_js.go unusable in Node.js tests
Labels: NeedsInvestigation,arch-wasm

<!-- Please answer these questions before submitting your issue. Thanks! -->

### What version of Go are you using (`go version`)?

<pre>
$ go version
go version go1.12.3 darwin/amd64
</pre>

### Does this issue reproduce with the latest release? Yes.



### What operating system and processor architecture are you using (`go env`)? 

<details><summary><code>go env</code></summary><br><pre>
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/fabioberger/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/fabioberger/Documents/projects/0x_project/go"
GOPROXY=""
GORACE=""
GOROOT="/Users/fabioberger/.go"
GOTMPDIR=""
GOTOOLDIR="/Users/fabioberger/.go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/91/m4w_p4fj06vc8vdzwqw7cqfc0000gn/T/go-build121993023=/tmp/go-build -gno-record-gcc-switches -fno-common"
</pre></details>

### What did you do?

I wrote a test that requires a network request to `localhost` using the `net/http` library, compiled it to WASM and attempted to run it using Node.js. In order to get it to work in a Node.js environment, I add a shim for `fetch` by requiring the `isomorphic-fetch` NPM package.

```
package main

import (
	"fmt"
	"net/http"
)

func TestRequest(t *testing.T) {

	client := &http.Client{}

	req, err := http.NewRequest("GET", "http://localhost:8545", nil)
	if err != nil {
		t.Fatal(err)
	}

	_, err = client.Do(req)
	if err != nil {
		t.Fatal(err)
	}

}

``` 


### What did you expect to see?

I expected the request to complete without an error.

### What did you see instead?

```
Post http://localhost:8545: dial tcp: Protocol not available
```

Digging into `roundtrip_js.go`, I found this check:

```
if useFakeNetwork() {
	return t.roundTrip(req)
}
```

Where `useFakeNetwork` is defined as:

```
// useFakeNetwork is used to determine whether the request is made
// by a test and should be made to use the fake in-memory network.
func useFakeNetwork() bool {
	return len(os.Args) > 0 && strings.HasSuffix(os.Args[0], ".test")
}
```

This logic means that _any_ test making a network request that gets compiled to WASM is re-routed to a fake in-memory network. Non-WASM tests do not exhibit this behavior.

Is there any chance the core devs would consider making this behavior optional? Perhaps via an environment variable?
Repository: flutter
Issue: On Windows, check if aria2, curl or wget are installed before downloading via BITS
Labels: c: new feature,tool,P3,team-tool,triaged-tool

**I'm just nitpicking**, I admit, but on my Windows systems I use [`Scoop`](https://github.com/lukesampson/scoop) and that allows me to install a bunch of commands like `aria2c`, `curl` and `wget`, all of which are incredibly faster than BITS.

You see, I like to *not* have to wait for an eternity to download something that takes 20 seconds with another program.

A solution to this would be to check if better tools are installed, then use those if available.

<!-- Thank you for using Flutter!

     If you are looking for support, please check out our documentation
     or consider asking a question on Stack Overflow:
      * https://flutter.dev/
      * https://docs.flutter.io/
      * https://stackoverflow.com/questions/tagged/flutter?sort=frequent

     If you have found a bug or if our documentation doesn't have an answer
     to what you're looking for, then fill our the template below. Please read
     our guide to filing a bug first:  https://flutter.dev/bug-reports/
-->

## Steps to Reproduce

<!-- Please tell us exactly how to reproduce the problem you are running into. -->

1. Install Flutter
2. Run `flutter`

## Logs

<!--
      Include the full logs of the commands you are running between the lines
      with the backticks below. If you are running any "flutter" commands,
      please include the output of running them with "--verbose"; for example,
      the output of running "flutter --verbose create foo".
-->

![flutter-bits](https://user-images.githubusercontent.com/10495562/56399267-e9a3ab00-621a-11e9-876a-a440af8bb7db.PNG)
Repository: vscode
Issue: [scss] Incorrect selector specificity in hover tooltip
Labels: bug,css-less-scss

<!-- Please search existing issues to avoid creating duplicates. -->
<!-- Also please test using the latest insiders build to make sure your issue has not already been fixed: https://code.visualstudio.com/insiders/ -->

<!-- Use Help > Report Issue to prefill these. -->
- VSCode Version: 1.33.1
- OS Version: Windows 10

Steps to Reproduce:

1. Type the code like
![image](https://user-images.githubusercontent.com/8168391/56423945-d3602280-62e0-11e9-88fc-8eb0bdc3f27d.png)
2. Move the mouse over `&__b`

![image](https://user-images.githubusercontent.com/8168391/56424018-128e7380-62e1-11e9-82d7-a5141b3c2b60.png)

The selector specificity is displayed as (0, 0, 0) instead of the correct (0, 1, 0), it being a class selector.

<!-- Launch with `code --disable-extensions` to check. -->
Does this issue occur when all extensions are disabled?: Yes/No
Yes.
Repository: TypeScript
Issue: flatMap errors when callback returns certain union types
Labels: Suggestion,Awaiting More Feedback

<!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨

Half of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker. Even if you think you've found a *bug*, please read the FAQ first, especially the Common "Bugs" That Aren't Bugs section!

Please help us by doing the following steps before logging an issue:
  * Search: https://github.com/Microsoft/TypeScript/search?type=Issues
  * Read the FAQ: https://github.com/Microsoft/TypeScript/wiki/FAQ

Please fill in the *entire* template below.
-->

<!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->
**TypeScript Version:**  3.4.3

<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
**Search Terms:** flat, flatmap

**Code**

```ts
// Map<string, number[]>
const myMap = new Map([
  ['foo', [1, 2, 3]],
  ['bar', [4, 5, 6]]
]);

// string[]
const myArray = ['foo', 'bar', 'baz'];

// (key: any) => number[] | undefined
const mapFn = key => myMap.get(key);

const flatMapped = myArray.flatMap(mapFn);
```

**Actual behavior:**

With strict null checks on:

```
Argument of type '(key: any) => number[] | undefined' is not assignable to parameter of type '(this: undefined, value: string, index: number, array: string[]) => number | readonly number[]'.
  Type 'number[] | undefined' is not assignable to type 'number | readonly number[]'.
    Type 'undefined' is not assignable to type 'number | readonly number[]'. ts(2345)
```

Turning strict null checks off prevents the error as you might expect, but that's obviously not desirable.

More generally, any callback that returns `foo[] | bar` (where `bar` is not compatible with `foo`) seems to run into the same issue. The `Map.prototype.get` example I've used here just seems like it would be a relatively common use case in particular (you'd typically follow it up by calling `.filter(Boolean)` or similar on the mapped result).

**More code**

Seeing if doing the operations separately will help:

```ts
// (number[] | undefined)[]
const mapped = myArray.map(mapFn);

// any[] !!
const flattened = mapped.flat();
```

**Expected behavior:**

`flatMapped`/`flattened` result to be inferred as `(number | undefined)[]`.

**Playground Link:** <!-- A link to a TypeScript Playground "Share" link which demonstrates this behavior -->

Doesn't seem to be able to load the appropriate library definition, even with `/// <reference lib="es2019.array" />`

**Related Issues:** <!-- Did you find other bugs that looked similar? -->

#29604 seems to be related to the `.flat()` part.
Repository: rust
Issue: Type alias definition changed during reexport
Labels: T-rustdoc,C-bug

Consider the following crate (`test2`):
```rust
pub trait Foo { }

pub type FooDyn = dyn Foo;

pub struct Bar;

impl Bar {
    pub fn bar(&self) -> &FooDyn {
        unimplemented!();
    }
}
```
Documentation for this crate says that `FooDyn` and `bar` signatures are the following:
```rust
type FooDyn = dyn Foo;
pub fn bar(&self) -> &FooDyn
```

You can assume that according to the lifetime elision rules you will get the following equivalent signature:
```rust
pub fn bar(&'a self) -> &'a FooDyn
```

However, it's not true. If you reexport `FooDyn` and `Bar` types in another crate (`test1`), you will get the following signatures in `test1` crate:
```rust
type FooDyn = dyn Foo + 'static;
pub fn bar(&self) -> &(dyn Foo + 'static)
```

One of the ways of resolving the issue is the following declaration:
```rust
pub type FooDyn<'a> = dyn 'a + Foo;
```

As for me, it's strange to have `'static` lifetime here by default, so maybe there should be an error if lifetime is omitted.
Repository: pytorch
Issue: C++ API 'nn::Sequential' has inconsistent behavior with python conterpart
Labels: module: cpp,triaged

## 🐛 Bug
## To Reproduce
C++ version
```c++
class FakeNet : public torch::nn::Module {
  public:
    FakeNet() {
        id = register_module("id", nn::Sequential());
    }
    torch::Tensor forward(torch::Tensor x) {
        // Runtime Error: Cannot call forward() on an empty Sequential
        return id->forward(x); 
    }
  private:
    nn::Sequential id;
}; 
```
Python Version
```python
class FakeNet(nn.Module):
    def __init___(self):
        self.id = nn.Sequential() 
    def forward(self, x):
        x = id(x) # OK
        return x
```
`nn::Sequential` doesn't overload `operator()` like other functions (e.g., `nn::Conv2d, nn::BatchNorm`), while in its `forward` function, it has an `AT_CHECK` on `is_empty() == false`, which makes using `nn::Sequential` as identity function impossible.  

## Suggestion
The C++ version should implement `nn::Sequential::operator()(...)`, which should silently return x when `is_empty() == true`.
  
## Environment
 - PyTorch Version (e.g., 1.0.1):
Repository: godot
Issue: Importer cannot load materials before images
Labels: bug,confirmed,usability,topic:import

**Godot version:**
3.1 stable

**OS/device including version:**
Windows 10, GTX 1080, 419.67

**Issue description:**
Imported a bunch of 3D Objects (Wavefront) and Textures at once. Godot couldn't load the Materials (.mtl) properly.

**Steps to reproduce:**
- Create a new Project
- Close Godot
- Make inside the Project a folder and put there some Wavefront Object with its Material Files
- Put also the Textures inside the folder
- Open godot and let it import everything
- Try to place one of the Objects: no texture or material on it
- Console also reports errors like:
```
ERROR: Couldn't open MTL file 'curve_01.mtl', it may not exist or not be readable.
   At: editor/import/resource_importer_obj.cpp:49
WARNING: _parse_material_library: OBJ: Ambient light for material 'street_01' is ignored in PBR
     At: editor/import/resource_importer_obj.cpp:67
ERROR: No loader found for resource: res://Models/Streets/street_base_01.png
   At: core/io/resource_loader.cpp:285
WARNING: _parse_material_library: OBJ: Ambient light for material 'street_01_NONE' is ignored in PBR
     At: editor/import/resource_importer_obj.cpp:67
ERROR: No loader found for resource: res://Models/Streets/street_base_01.png
   At: core/io/resource_loader.cpp:285
```
Repository: godot
Issue: Thirdparty Base64 license is *possibly* missing
Labels: discussion,topic:thirdparty

**Godot version:**
**All** versions of Godot starting with **1.0**, maybe even **before the first release**.

**Issue description:**
**/thirdparty/misc/base64.[c|h]** (**/core/io/base64.[c|h]** in Godot 1.0) claim that the files are in public domain and provide a link to the site of the author. The same is stated in **/COPYRIGHT.txt**. However, there is no dedication to public domain in the provided link and I can't find even a mention of license or usage conditions/public domain dedication, even by searching their site with google. The author seems to have a github account with a [project that contains base64 code](https://github.com/edelkind/filthttp), but just like before, there is no license/dedication/conditions.

Either there was a dedication and it was lost to time (couldn't find it even with Wayback Machine), or the "public domain" was attached by a mistake. The files might need to be removed and rewritten or replaced with another base64 library.
Repository: pytorch
Issue: [jit] Bad error when calling `ScriptModule`s with attributes/parameters
Labels: oncall: jit,triaged

```python
class Vocab(torch.jit.ScriptModule):
    def __init__(self):
        self.i = torch.jit.Attribute(2, int)

    @torch.jit.script_method
    def forward(self, x):
        return x + self.i

v = Vocab()

@torch.jit.script
def lookup(y):
    return v(y)
```

results in 

```
for operator forward(Tensor x, int slot0) -> Tensor:
argument slot0 not provided.
@torch.jit.script
def lookup(y):
    return v(y)
           ~ <--- HERE
:
@torch.jit.script
def lookup(y):
    return v(y)
```
Script functions cannot call stateful modules, so this should produce an error but it should say something to that effect instead of a schema-mismatch.
Repository: godot
Issue: Can't create function named "_text_changed" in LineEdit
Labels: bug,topic:core,confirmed

**Godot version:** 3.1

**Issue description:**
Trying to create a function named `_text_changed` without any arguments in a script which extends `LineEdit` works fine. Trying to add an argument creates an error: 
![image](https://user-images.githubusercontent.com/8056898/56441078-18d61d00-62ec-11e9-8d19-4d6da274341e.png)
The problem is, that I can't find the "parent's function". `void _text_changed()` doesn't seem to exist.


**Steps to reproduce:**
Create LineEdit.
Attach a script.
Add the line `void _text_changed(a):`
Receive an error
Repository: godot
Issue: Use the same region for equal images in Texture Atlas importer
Labels: enhancement,topic:editor

<!-- Please search existing issues for potential duplicates before filing yours:
https://github.com/godotengine/godot/issues?q=is%3Aissue
-->

**Godot version:**
1120b0b


**OS/device including version:**
5.0.7-arch1-1-ARCH


**Issue description:**
Just a suggestion, atlas pack could be even better if we don't repeat the same textures like this example below:
![Captura de tela de 2019-04-19 17-59-12](https://user-images.githubusercontent.com/1387165/56443883-dd782600-62cc-11e9-8602-80f4cffa7371.png)
I work with thousands of frames and some of them are repeated for some animations.
Repository: TypeScript
Issue: Go to definition unnecessary shows export along true definition
Labels: Bug,Domain: Symbol Navigation

<!-- Please search existing issues to avoid creating duplicates. -->
<!-- Also please test using the latest insiders build to make sure your issue has not already been fixed: https://code.visualstudio.com/insiders/ -->

<!-- Use Help > Report Issue to prefill these. -->
- VSCode Version: 1.33.1 and 1.34.0-insiders
- OS Version: Arch Linux

Steps to Reproduce:

1. create foo.js
```
function foo() {}

module.exports = { foo };
```
create bar.js
```
const foo = require('./foo');

foo.foo();
```
2. In bar.js Ctrl+click on foo() to go to definition. 
It shows both function definition and export from modules.exports
![2019-04-16-201758_592x252_scrot](https://user-images.githubusercontent.com/1936195/56235129-1757eb00-6087-11e9-9384-332307687b0e.png)

<!-- Launch with `code --disable-extensions` to check. -->
Does this issue occur when all extensions are disabled?: Yes
Repository: flutter
Issue: flutter plugins references to flutter.io should probably be flutter.dev
Labels: team,package,team-ecosystem,P3,p: requires breaking change,triaged-ecosystem

There are several places where flutter.io appears in the flutter/plugins repo, mostly in method channel names and Android namespaces. We might want to update this to flutter.dev.
Repository: vscode
Issue: Yank back killed text `ctrl+y` stopped working
Labels: feature-request,macos,editor-commands

<!-- Please search existing issues to avoid creating duplicates. -->
<!-- Also please test using the latest insiders build to make sure your issue has not already been fixed: https://code.visualstudio.com/insiders/ -->

<!-- Use Help > Report Issue to prefill these. -->
- VSCode Version: 1.33.1 ( Recent )
- OS Version: Mac 10.14.4

Steps to Reproduce:

1. `ctrl+k` to kill text.
2. `ctrl+y` to paste the kill text does not work.

<!-- Launch with `code --disable-extensions` to check. -->
Does this issue occur when all extensions are disabled?: Yes


Works on all other program except vscode.