helloadhavan/github_issues huggingface dataset:
Repository: electron/electron
Pull request: fix: remove unused local variables

Backport of #44815

See that PR for details.


Notes: none.

Changed files:
filename: shell/browser/api/electron_api_app.cc
patch: @@ -1010,8 +1010,6 @@ bool App::RequestSingleInstanceLock(gin::Arguments* args) {
   if (HasSingleInstanceLock())
     return true;
 
-  std::string program_name = electron::Browser::Get()->GetName();
-
   base::FilePath user_dir;
   base::PathService::Get(chrome::DIR_USER_DATA, &user_dir);
   // The user_dir may not have been created yet.
@@ -1022,6 +1020,7 @@ bool App::RequestSingleInstanceLock(gin::Arguments* args) {
   blink::CloneableMessage additional_data_message;
   args->GetNext(&additional_data_message);
 #if BUILDFLAG(IS_WIN)
+  const std::string program_name = electron::Browser::Get()->GetName();
   bool app_is_sandboxed =
       IsSandboxEnabled(base::CommandLine::ForCurrentProcess());
   process_singleton_ = std::make_unique<ProcessSingleton>(

filename: shell/browser/relauncher.cc
patch: @@ -157,7 +157,6 @@ int RelauncherMain(const content::MainFunctionParams& main_parameters) {
   // Figure out what to execute, what arguments to pass it, and whether to
   // start it in the background.
   bool in_relauncher_args = false;
-  StringType relaunch_executable;
   StringVector relauncher_args;
   StringVector launch_argv;
   for (size_t argv_index = 2; argv_index < argv.size(); ++argv_index) {

filename: shell/browser/ui/views/global_menu_bar_registrar_x11.cc
patch: @@ -80,7 +80,6 @@ void GlobalMenuBarRegistrarX11::RegisterXWindow(x11::Window window) {
 
 void GlobalMenuBarRegistrarX11::UnregisterXWindow(x11::Window window) {
   DCHECK(registrar_proxy_);
-  std::string path = electron::GlobalMenuBarX11::GetPathForWindow(window);
 
   ANNOTATE_SCOPED_MEMORY_LEAK;  // http://crbug.com/314087
   // TODO(erg): The mozilla implementation goes to a lot of callback trouble
Repository: nodejs/node
Pull request: src: remove deleted tls file

Refs https://github.com/nodejs/node/pull/57361

cc @JonasBa

Fixes the following:

```
node on git:main ❯ ninja -C out/Release                       10:13AM
ninja: Entering directory `out/Release'
ninja: error: '../../lib/internal/tls/secure-pair.js', needed by 'gen/node_javascript.cc', missing and no known rule to make it
```
<!--
Before submitting a pull request, please read:

- the CONTRIBUTING guide at https://github.com/nodejs/node/blob/HEAD/CONTRIBUTING.md
- the commit message formatting guidelines at
  https://github.com/nodejs/node/blob/HEAD/doc/contributing/pull-requests.md#commit-message-guidelines

For code changes:
1. Include tests for any bug fixes or new features.
2. Update documentation if relevant.
3. Ensure that `make -j4 test` (UNIX), or `vcbuild test` (Windows) passes.

If you believe this PR should be highlighted in the Node.js CHANGELOG
please add the `notable-change` label.

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.
-->


Changed files:
filename: src/node_builtins.cc
patch: @@ -122,10 +122,9 @@ BuiltinLoader::BuiltinCategories BuiltinLoader::GetBuiltinCategories() const {
 
 #if !HAVE_OPENSSL
         "crypto", "crypto/promises", "https", "http2", "tls", "_tls_common",
-        "_tls_wrap", "internal/tls/secure-pair",
-        "internal/tls/parse-cert-string", "internal/tls/secure-context",
-        "internal/http2/core", "internal/http2/compat",
-        "internal/streams/lazy_transform",
+        "_tls_wrap", "internal/tls/parse-cert-string",
+        "internal/tls/secure-context", "internal/http2/core",
+        "internal/http2/compat", "internal/streams/lazy_transform",
 #endif           // !HAVE_OPENSSL
 #if !NODE_OPENSSL_HAS_QUIC
         "internal/quic/quic", "internal/quic/symbols", "internal/quic/stats",
Repository: denoland/deno
Pull request: ci: use self-hosted mac arm runner on tags


Changed files:
filename: .github/workflows/ci.generate.ts
patch: @@ -46,9 +46,9 @@ const Runners = {
   macosArmSelfHosted: {
     os: "macos",
     arch: "aarch64",
-    // Actually use self-hosted runner only in denoland/deno on `main` branch.
+    // Actually use self-hosted runner only in denoland/deno on `main` branch and for tags (release) builds.
     runner:
-      `\${{ github.repository == 'denoland/deno' && github.ref == 'refs/heads/main' && '${selfHostedMacosArmRunner}' || '${macosArmRunner}' }}`,
+      `\${{ github.repository == 'denoland/deno' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) && '${selfHostedMacosArmRunner}' || '${macosArmRunner}' }}`,
   },
   windowsX86: {
     os: "windows",

filename: .github/workflows/ci.yml
patch: @@ -73,7 +73,7 @@ jobs:
             profile: debug
           - os: macos
             arch: aarch64
-            runner: '${{ (!contains(github.event.pull_request.labels.*.name, ''ci-full'') && (github.event_name == ''pull_request'')) && ''ubuntu-24.04'' || github.repository == ''denoland/deno'' && github.ref == ''refs/heads/main'' && ''ghcr.io/cirruslabs/macos-runner:sonoma'' || ''macos-14'' }}'
+            runner: '${{ (!contains(github.event.pull_request.labels.*.name, ''ci-full'') && (github.event_name == ''pull_request'')) && ''ubuntu-24.04'' || github.repository == ''denoland/deno'' && (github.ref == ''refs/heads/main'' || startsWith(github.ref, ''refs/tags/'')) && ''ghcr.io/cirruslabs/macos-runner:sonoma'' || ''macos-14'' }}'
             job: test
             profile: release
             skip: '${{ !contains(github.event.pull_request.labels.*.name, ''ci-full'') && (github.event_name == ''pull_request'') }}'
Repository: nodejs/node
Pull request: doc: prefer to sign commits under nodejs repository

Although not required, I think adding this as a "recommended" is a good thing.

cc: @aduh95 

Changed files:
filename: doc/contributing/releases.md
patch: @@ -111,6 +111,9 @@ The key you use may be a child/subkey of an existing key.
 Additionally, full GPG key fingerprints for individuals authorized to release
 should be listed in the Node.js GitHub README.md file.
 
+> It is recommended to sign all commits under the Node.js repository.
+> Run: `git config commit.gpgsign true` inside the `node` folder.
+
 ## How to create a release
 
 Notes:
Repository: facebook/react
Pull request: Fix Flow types of useEffectEvent

## Summary

Just copied the types over from the internal types. Type error was hidden by overly broad FlowFixMe. With `$FlowFixMe[not-a-function]` we would've seen the actual issue: 
```
Cannot return `dispatcher.useEffectEvent(...)` because  `T` [1] is incompatible with  undefined [2].Flow(incompatible-return)
```

## How did you test this change?

- [x] yarn flow dom-node
- [x] CI


Changed files:
filename: packages/react-reconciler/src/ReactInternalTypes.js
patch: @@ -383,9 +383,7 @@ export type Dispatcher = {
     create: () => (() => void) | void,
     deps: Array<mixed> | void | null,
   ): void,
-  useEffectEvent?: <Args, Return, F: (...Array<Args>) => Return>(
-    callback: F,
-  ) => F,
+  useEffectEvent?: <Args, F: (...Array<Args>) => mixed>(callback: F) => F,
   useInsertionEffect(
     create: () => (() => void) | void,
     deps: Array<mixed> | void | null,

filename: packages/react/src/ReactHooks.js
patch: @@ -218,24 +218,26 @@ export function useSyncExternalStore<T>(
 
 export function useCacheRefresh(): <T>(?() => T, ?T) => void {
   const dispatcher = resolveDispatcher();
-  // $FlowFixMe This is unstable, thus optional
+  // $FlowFixMe[not-a-function] This is unstable, thus optional
   return dispatcher.useCacheRefresh();
 }
 
 export function use<T>(usable: Usable<T>): T {
   const dispatcher = resolveDispatcher();
-  // $FlowFixMe This is unstable, thus optional
+  // $FlowFixMe[not-a-function] This is unstable, thus optional
   return dispatcher.use(usable);
 }
 
 export function useMemoCache(size: number): Array<any> {
   const dispatcher = resolveDispatcher();
-  // $FlowFixMe This is unstable, thus optional
+  // $FlowFixMe[not-a-function] This is unstable, thus optional
   return dispatcher.useMemoCache(size);
 }
 
-export function useEffectEvent<T>(callback: T): void {
+export function useEffectEvent<Args, F: (...Array<Args>) => mixed>(
+  callback: F,
+): F {
   const dispatcher = resolveDispatcher();
-  // $FlowFixMe This is unstable, thus optional
+  // $FlowFixMe[not-a-function] This is unstable, thus optional
   return dispatcher.useEffectEvent(callback);
 }
Repository: ggml-org/llama.cpp
Pull request: OpenCL: fix profiling crash in llama-bench

ref https://github.com/ggml-org/llama.cpp/pull/15042

Changed files:
filename: ggml/src/ggml-opencl/ggml-opencl.cpp
patch: @@ -602,6 +602,7 @@ struct ggml_backend_opencl_context {
         if (ref_count == 0) {
 #ifdef GGML_OPENCL_PROFILING
             write_profiling_info();
+            profiling_info.clear();
 #endif
         }
     }
Repository: electron/electron
Pull request: fix: remove unused local variables

Backport of #44815

See that PR for details.


Notes: none.

Changed files:
filename: shell/browser/api/electron_api_app.cc
patch: @@ -1011,8 +1011,6 @@ bool App::RequestSingleInstanceLock(gin::Arguments* args) {
   if (HasSingleInstanceLock())
     return true;
 
-  std::string program_name = electron::Browser::Get()->GetName();
-
   base::FilePath user_dir;
   base::PathService::Get(chrome::DIR_USER_DATA, &user_dir);
   // The user_dir may not have been created yet.
@@ -1023,6 +1021,7 @@ bool App::RequestSingleInstanceLock(gin::Arguments* args) {
   blink::CloneableMessage additional_data_message;
   args->GetNext(&additional_data_message);
 #if BUILDFLAG(IS_WIN)
+  const std::string program_name = electron::Browser::Get()->GetName();
   bool app_is_sandboxed =
       IsSandboxEnabled(base::CommandLine::ForCurrentProcess());
   process_singleton_ = std::make_unique<ProcessSingleton>(

filename: shell/browser/relauncher.cc
patch: @@ -157,7 +157,6 @@ int RelauncherMain(const content::MainFunctionParams& main_parameters) {
   // Figure out what to execute, what arguments to pass it, and whether to
   // start it in the background.
   bool in_relauncher_args = false;
-  StringType relaunch_executable;
   StringVector relauncher_args;
   StringVector launch_argv;
   for (size_t argv_index = 2; argv_index < argv.size(); ++argv_index) {

filename: shell/browser/ui/views/global_menu_bar_registrar_x11.cc
patch: @@ -80,7 +80,6 @@ void GlobalMenuBarRegistrarX11::RegisterXWindow(x11::Window window) {
 
 void GlobalMenuBarRegistrarX11::UnregisterXWindow(x11::Window window) {
   DCHECK(registrar_proxy_);
-  std::string path = electron::GlobalMenuBarX11::GetPathForWindow(window);
 
   ANNOTATE_SCOPED_MEMORY_LEAK;  // http://crbug.com/314087
   // TODO(erg): The mozilla implementation goes to a lot of callback trouble
Repository: denoland/deno
Pull request: fix(ext/node): propagate socket error to client request object

This addresses the 2nd part of #27670

Currently if socket errors with DNS error, then there's no way to handle it and it becomes uncaught error. This PR propagate it to ClientRequest object and the error can be handled with 'error' event listener on it.

- [x] write test cases 

Changed files:
filename: ext/node/polyfills/http.ts
patch: @@ -455,8 +455,13 @@ class ClientRequest extends OutgoingMessage {
     (async () => {
       try {
         const parsedUrl = new URL(url);
-        let baseConnRid =
-          this.socket._handle[kStreamBaseField][internalRidSymbol];
+        const handle = this.socket._handle;
+        if (!handle) {
+          // Using non-standard socket. There's no way to handle this type of socket.
+          // This should be only happening in artificial test cases
+          return;
+        }
+        let baseConnRid = handle[kStreamBaseField][internalRidSymbol];
         if (this._encrypted) {
           [baseConnRid] = op_tls_start({
             rid: baseConnRid,
@@ -637,6 +642,12 @@ class ClientRequest extends OutgoingMessage {
         };
         this.socket = socket;
         this.emit("socket", socket);
+        socket.once("error", (err) => {
+          // This callback loosely follow `socketErrorListener` in Node.js
+          // https://github.com/nodejs/node/blob/f16cd10946ca9ad272f42b94f00cf960571c9181/lib/_http_client.js#L509
+          emitErrorEvent(this, err);
+          socket.destroy(err);
+        });
         if (socket.readyState === "opening") {
           socket.on("connect", onConnect);
         } else {

filename: tests/unit_node/http_test.ts
patch: @@ -1881,3 +1881,14 @@ Deno.test("[node/http] decompress brotli response", {
     "localhost:3000",
   ], ["user-agent", "Deno/2.1.1"]]);
 });
+
+Deno.test("[node/http] an error with DNS propagates to request object", async () => {
+  const { resolve, promise } = Promise.withResolvers<void>();
+  const req = http.request("http://invalid-hostname.test", () => {});
+  req.on("error", (err) => {
+    assertEquals(err.name, "Error");
+    assertEquals(err.message, "getaddrinfo ENOTFOUND invalid-hostname.test");
+    resolve();
+  });
+  await promise;
+});
Repository: vercel/next.js
Pull request: Turbopack: resolve `sourceMap.file`

This information is needed in #79459 to match up the right input source maps.

Closes PACK-4851

Changed files:
filename: turbopack/crates/turbopack-core/src/source_map/utils.rs
patch: @@ -69,15 +69,15 @@ struct SourceMapJson {
     sections: Option<Vec<SourceMapSectionItemJson>>,
 }
 
-/// Replace the origin prefix in the `sources` with `turbopack:///` and read the the
+/// Replace the origin prefix in the `file` and `sources` with `turbopack:///` and read the the
 /// `sourceContent`s from disk.
 pub async fn resolve_source_map_sources(
     map: Option<&Rope>,
     origin: Vc<FileSystemPath>,
 ) -> Result<Option<Rope>> {
     async fn resolve_source(
         original_source: &mut String,
-        original_content: &mut Option<String>,
+        original_content: Option<&mut Option<String>>,
         origin: Vc<FileSystemPath>,
     ) -> Result<()> {
         if let Some(path) = *origin
@@ -89,7 +89,9 @@ pub async fn resolve_source_map_sources(
             let source = format!("{SOURCE_URL_PROTOCOL}///{path_str}");
             *original_source = source;
 
-            if original_content.is_none() {
+            if let Some(original_content) = original_content
+                && original_content.is_none()
+            {
                 if let FileContent::Content(file) = &*path.read().await? {
                     let text = file.content().to_str()?;
                     *original_content = Some(text.to_string())
@@ -105,7 +107,9 @@ pub async fn resolve_source_map_sources(
                 s[0].replace('.', "_")
             });
             *original_source = format!("{SOURCE_URL_PROTOCOL}///{origin_str}/{source}");
-            if original_content.is_none() {
+            if let Some(original_content) = original_content
+                && original_content.is_none()
+            {
                 *original_content = Some(format!(
                     "unable to access {original_source} in {origin_str} (it's leaving the \
                      filesystem root)"
@@ -126,7 +130,7 @@ pub async fn resolve_source_map_sources(
 
             for (source, content) in sources.iter_mut().zip(contents.iter_mut()) {
                 if let Some(source) = source {
-                    resolve_source(source, content, origin).await?;
+                    resolve_source(source, Some(content), origin).await?;
                 }
             }
 
@@ -144,6 +148,10 @@ pub async fn resolve_source_map_sources(
         return Ok(None);
     };
 
+    if let Some(file) = &mut map.file {
+        resolve_source(file, None, origin).await?;
+    }
+
     resolve_map(&mut map, origin).await?;
     for section in map.sections.iter_mut().flatten() {
         resolve_map(&mut section.map, origin).await?;
Repository: denoland/deno
Pull request: fix(outdated): Use `latest` tag even when it's the same as the current version

Fixes https://github.com/denoland/deno/issues/27696.

Just a `>` that should've been a `>=`. Also made sure to filter out deprecated versions.

Changed files:
filename: cli/tools/registry/pm/deps.rs
patch: @@ -683,10 +683,21 @@ impl DepManager {
               .and_then(|info| {
                 let latest_tag = info.dist_tags.get("latest")?;
                 let lower_bound = &semver_compatible.as_ref()?.version;
-                if latest_tag > lower_bound {
+                if latest_tag >= lower_bound {
                   Some(latest_tag.clone())
                 } else {
-                  latest_version(Some(latest_tag), info.versions.keys())
+                  latest_version(
+                    Some(latest_tag),
+                    info.versions.iter().filter_map(
+                      |(version, version_info)| {
+                        if version_info.deprecated.is_none() {
+                          Some(version)
+                        } else {
+                          None
+                        }
+                      },
+                    ),
+                  )
                 }
               })
               .map(|version| PackageNv {

filename: tests/specs/update/latest_not_pre_release/__test__.jsonc
patch: @@ -0,0 +1,13 @@
+{
+  "tempDir": true,
+  "steps": [
+    {
+      "args": "install",
+      "output": "[WILDCARD]"
+    },
+    {
+      "args": "outdated",
+      "output": ""
+    }
+  ]
+}

filename: tests/specs/update/latest_not_pre_release/package.json
patch: @@ -0,0 +1,5 @@
+{
+  "dependencies": {
+    "@denotest/has-pre-release": "1.0.0"
+  }
+}
Repository: facebook/react
Pull request: [DevTools] missing file name in package.json

resolves https://github.com/facebook/react/pull/26337#issuecomment-1483004732

Changed files:
filename: packages/react-devtools/package.json
patch: @@ -16,7 +16,8 @@
     "app.html",
     "app.js",
     "index.js",
-    "icons"
+    "icons",
+    "preload.js"
   ],
   "scripts": {
     "start": "node bin.js"
Repository: electron/electron
Pull request: fix: crash calling `shell.readShortcutLink`

Backport of #44784

See that PR for details.


Notes: Fixed a crash that could occur when calling `shell.readShortcutLink` on Windows.

Changed files:
filename: patches/chromium/.patches
patch: @@ -135,3 +135,4 @@ ui_add_missing_shortcut_text_for_vkey_command_on_linux.patch
 osr_shared_texture_remove_keyed_mutex_on_win_dxgi.patch
 refactor_unfilter_unresponsive_events.patch
 wayland_support_outgoing_dnd_sessions_with_no_offered_mime_types.patch
+support_bstr_pkey_appusermodel_id_in_windows_shortcuts.patch

filename: patches/chromium/support_bstr_pkey_appusermodel_id_in_windows_shortcuts.patch
patch: @@ -0,0 +1,47 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Shelley Vohr <shelley.vohr@gmail.com>
+Date: Thu, 21 Nov 2024 14:23:17 +0100
+Subject: Support BSTR PKEY_AppUserModel_ID in Windows Shortcuts
+
+It's possible for a shortcut link on Windows to be BSTR format;
+this resulted in a DCHECK previously but as of the NOTREACHED
+fatal migration now will crash a given app. This has created an
+issue for Electron, which allows providing the shortcut information
+to end users. This CL thus allows for supporting VT_BSTR variants
+for PKEY_AppUserModel_ID and mitigates a crash. One such example
+is https://github.com/wez/wezterm, which after this change
+correctly gets an appUserModelId of 'org.wezfurlong.wezterm'.
+
+Bug: N/A
+Change-Id: I5ad114bc345059637465b68a53a2f3f8c42de898
+
+diff --git a/base/win/shortcut.cc b/base/win/shortcut.cc
+index d4a54d1afdc121192f9c0321c6ced584ee066486..02f3e63d16c3324f546f6155d722900f0a81131a 100644
+--- a/base/win/shortcut.cc
++++ b/base/win/shortcut.cc
+@@ -289,14 +289,22 @@ bool ResolveShortcutProperties(const FilePath& shortcut_path,
+         return false;
+       }
+       switch (pv_app_id.get().vt) {
+-        case VT_EMPTY:
++        case VT_EMPTY: {
+           properties->set_app_id(std::wstring());
+           break;
+-        case VT_LPWSTR:
++        }
++        case VT_LPWSTR: {
+           properties->set_app_id(pv_app_id.get().pwszVal);
+           break;
+-        default:
++        }
++        case VT_BSTR: {
++          BSTR bs = pv_app_id.get().bstrVal;
++          properties->set_app_id(std::wstring(bs, ::SysStringLen(bs)));
++          break;
++        }
++        default: {
+           NOTREACHED() << "Unexpected variant type: " << pv_app_id.get().vt;
++        }
+       }
+     }
+
Repository: ggml-org/llama.cpp
Pull request: model : fix hunyuan chat template

fix #14878 
Fixed the hunyuan chat-template issue, please use the latest model for inference.

Changed files:
filename: src/llama-chat.cpp
patch: @@ -193,11 +193,11 @@ llm_chat_template llm_chat_detect_template(const std::string & tmpl) {
         return LLM_CHAT_TEMPLATE_LLAMA4;
     } else if (tmpl_contains("
")) {
         return LLM_CHAT_TEMPLATE_DOTS1;
-    } else if (tmpl_contains("
") && tmpl_contains("
")) {
+    } else if (tmpl_contains("
") && tmpl_contains("
")) {
         return LLM_CHAT_TEMPLATE_HUNYUAN_MOE;
     } else if (tmpl_contains("
") && tmpl_contains("
")) {
         return LLM_CHAT_TEMPLATE_OPENAI_MOE;
-    } else if (tmpl_contains("<｜hy_place▁holder▁no▁2｜>") && tmpl_contains("<｜hy_place▁holder▁no▁3｜>")) {
+    } else if (tmpl_contains("<｜hy_Assistant｜>") && tmpl_contains("<｜hy_place▁holder▁no▁3｜>")) {
         return LLM_CHAT_TEMPLATE_HUNYUAN_DENSE;
     } else if (tmpl_contains("
assistant
")) {
         return LLM_CHAT_TEMPLATE_KIMI_K2;
Repository: denoland/deno
Pull request: fix(ext/console): change Temporal color

This commit changes output color of `Temporal` instances from
"magenta" to "cyan" to discriminate them from `Date` instances.

Closes https://github.com/denoland/deno/issues/27585

Before:
![Screenshot 2025-01-15 at 17 44 30](https://github.com/user-attachments/assets/f6a5a99d-1026-4583-b9e0-6420feef0635)

After:
![Screenshot 2025-01-15 at 17 44 35](https://github.com/user-attachments/assets/6ea96615-0130-42ef-a3b3-7ea9b37a0177)


Changed files:
filename: ext/console/01_console.js
patch: @@ -216,7 +216,7 @@ const styles = {
   regexp: "red",
   module: "underline",
   internalError: "red",
-  temporal: "magenta",
+  temporal: "cyan",
 };
 
 const defaultFG = 39;