helloadhavan/github_issues huggingface dataset:
Repository: vercel/next.js
Pull request: [segment explorer] reset error and not-found boundary

### Description

Add a `key` prop to the segment state boundary and change the key when we call reset, this way it will force the children re-render with the new state where the boundaries will get reset and the simulated error will be gone since we're rendering the page component now.

Reseting the error boundary only won't help, it will still get the error from `getDerivedStateFromError` class method and apply to the state. This approach will reset the state group of layout-router, and ensure we keep rendering the page segment (or anything by default).

### Video

https://github.com/user-attachments/assets/f6fc21da-abc1-41fc-857f-136a203f6039


Closes NEXT-4583

Changed files:
filename: packages/next/src/next-devtools/userspace/app/segment-explorer-node.tsx
patch: @@ -1,7 +1,14 @@
 'use client'
 
 import type { ReactNode } from 'react'
-import { useState, createContext, useContext, use, useMemo } from 'react'
+import {
+  useState,
+  createContext,
+  useContext,
+  use,
+  useMemo,
+  useCallback,
+} from 'react'
 import { useLayoutEffect } from 'react'
 import { dispatcher } from 'next/dist/compiled/next-devtools'
 import { notFound } from '../../../client/components/not-found'
@@ -117,8 +124,27 @@ export function SegmentStateProvider({ children }: { children: ReactNode }) {
     'not-found' | 'error' | 'loading' | null
   >(null)
 
+  const [errorBoundaryKey, setErrorBoundaryKey] = useState(0)
+  const reloadBoundary = useCallback(
+    () => setErrorBoundaryKey((prev) => prev + 1),
+    []
+  )
+
+  const setBoundaryTypeAndReload = useCallback(
+    (type: 'not-found' | 'error' | 'loading' | null) => {
+      if (type === null) {
+        reloadBoundary()
+      }
+      setBoundaryType(type)
+    },
+    [reloadBoundary]
+  )
+
   return (
-    <SegmentStateContext.Provider value={{ boundaryType, setBoundaryType }}>
+    <SegmentStateContext.Provider
+      key={errorBoundaryKey}
+      value={{ boundaryType, setBoundaryType: setBoundaryTypeAndReload }}
+    >
       {children}
     </SegmentStateContext.Provider>
   )
Repository: nodejs/node
Pull request: src: move windows specific fns to _WIN32

We don't need to define these functions for non-windows systems. We can just put it behind a _WIN32 defined check.

Changed files:
filename: src/util-inl.h
patch: @@ -28,10 +28,13 @@
 #include <cstring>
 #include <locale>
 #include <ranges>
-#include <regex>  // NOLINT(build/c++11)
 #include "node_revert.h"
 #include "util.h"
 
+#ifdef _WIN32
+#include <regex>  // NOLINT(build/c++11)
+#endif            // _WIN32
+
 #define CHAR_TEST(bits, name, expr)                                           \
   template <typename T>                                                       \
   bool name(const T ch) {                                                     \
@@ -588,9 +591,8 @@ constexpr std::string_view FastStringKey::as_string_view() const {
   return name_;
 }
 
-// Inline so the compiler can fully optimize it away on Unix platforms.
-bool IsWindowsBatchFile(const char* filename) {
 #ifdef _WIN32
+inline bool IsWindowsBatchFile(const char* filename) {
   std::string file_with_extension = filename;
   // Regex to match the last extension part after the last dot, ignoring
   // trailing spaces and dots
@@ -603,12 +605,8 @@ bool IsWindowsBatchFile(const char* filename) {
   }
 
   return !extension.empty() && (extension == "cmd" || extension == "bat");
-#else
-  return false;
-#endif  // _WIN32
 }
 
-#ifdef _WIN32
 inline std::wstring ConvertToWideString(const std::string& str,
                                         UINT code_page) {
   int size_needed = MultiByteToWideChar(

filename: src/util.h
patch: @@ -1026,9 +1026,12 @@ v8::Maybe<int> GetValidFileMode(Environment* env,
                                 v8::Local<v8::Value> input,
                                 uv_fs_type type);
 
+#ifdef _WIN32
 // Returns true if OS==Windows and filename ends in .bat or .cmd,
 // case insensitive.
 inline bool IsWindowsBatchFile(const char* filename);
+inline std::wstring ConvertToWideString(const std::string& str, UINT code_page);
+#endif  // _WIN32
 
 }  // namespace node
Repository: electron/electron
Pull request: build: remove outdated Node.js serdes patch

Backport of #45401.

See that PR for details.

Notes: none

Changed files:
filename: patches/node/.patches
patch: @@ -12,7 +12,6 @@ fix_crypto_tests_to_run_with_bssl.patch
 fix_account_for_debugger_agent_race_condition.patch
 fix_readbarrier_undefined_symbol_error_on_woa_arm64.patch
 fix_suppress_clang_-wdeprecated-declarations_in_libuv.patch
-fix_serdes_test.patch
 feat_add_uv_loop_interrupt_on_io_change_option_to_uv_loop_configure.patch
 support_v8_sandboxed_pointers.patch
 build_ensure_native_module_compilation_fails_if_not_using_a_new.patch

filename: patches/node/fix_serdes_test.patch
patch: @@ -1,34 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Jeremy Rose <nornagon@nornagon.net>
-Date: Fri, 28 Jan 2022 13:50:21 -0800
-Subject: fix serdes test
-
-The V8 wire format version changed.
-
-diff --git a/test/parallel/test-v8-serdes.js b/test/parallel/test-v8-serdes.js
-index 296e076a9f760d94293fe4310d6f3a081e3e59f4..be6deaf463977cc65e9f135008c3ce2b2919e22f 100644
---- a/test/parallel/test-v8-serdes.js
-+++ b/test/parallel/test-v8-serdes.js
-@@ -163,11 +163,11 @@ const hostObject = new (internalBinding('js_stream').JSStream)();
- 
- {
-   // Test that an old serialized value can still be deserialized.
--  const buf = Buffer.from('ff0d6f2203666f6f5e007b01', 'hex');
-+  const buf = Buffer.from('ff0f6f2203666f6f5e007b01', 'hex');
- 
-   const des = new v8.DefaultDeserializer(buf);
-   des.readHeader();
--  assert.strictEqual(des.getWireFormatVersion(), 0x0d);
-+  assert.strictEqual(des.getWireFormatVersion(), 0x0f);
- 
-   const value = des.readValue();
-   assert.strictEqual(value, value.foo);
-@@ -202,7 +202,7 @@ const hostObject = new (internalBinding('js_stream').JSStream)();
- {
-   // Unaligned Uint16Array read, with padding in the underlying array buffer.
-   let buf = Buffer.alloc(32 + 9);
--  buf.write('ff0d5c0404addeefbe', 32, 'hex');
-+  buf.write('ff0e5c0404addeefbe', 32, 'hex');
-   buf = buf.slice(32);
- 
-   const expectedResult = os.endianness() === 'LE' ?
Repository: electron/electron
Pull request: build: remove outdated Node.js serdes patch

#### Description of Change

This no longer became necessary after Node.js refactored a bit in https://github.com/nodejs/node/pull/42657 - tests pass without changes now.

#### Checklist
<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

- [x] PR description included and stakeholders cc'd
- [x] `npm test` passes
- [x] [PR release notes](https://github.com/electron/clerk/blob/main/README.md) describe the change in a way relevant to app developers, and are [capitalized, punctuated, and past tense](https://github.com/electron/clerk/blob/main/README.md#examples).

#### Release Notes

Notes: none


Changed files:
filename: patches/node/.patches
patch: @@ -9,7 +9,6 @@ chore_allow_the_node_entrypoint_to_be_a_builtin_module.patch
 fix_handle_boringssl_and_openssl_incompatibilities.patch
 fix_crypto_tests_to_run_with_bssl.patch
 fix_account_for_debugger_agent_race_condition.patch
-fix_serdes_test.patch
 feat_add_uv_loop_interrupt_on_io_change_option_to_uv_loop_configure.patch
 support_v8_sandboxed_pointers.patch
 build_ensure_native_module_compilation_fails_if_not_using_a_new.patch

filename: patches/node/fix_serdes_test.patch
patch: @@ -1,34 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Jeremy Rose <nornagon@nornagon.net>
-Date: Fri, 28 Jan 2022 13:50:21 -0800
-Subject: fix serdes test
-
-The V8 wire format version changed.
-
-diff --git a/test/parallel/test-v8-serdes.js b/test/parallel/test-v8-serdes.js
-index c87ed89353af3b52362e8afcfbce42f1ae759774..3de1dbc5fe571b5b4abd767049eec25773268b48 100644
---- a/test/parallel/test-v8-serdes.js
-+++ b/test/parallel/test-v8-serdes.js
-@@ -167,11 +167,11 @@ const hostObject = new (internalBinding('js_stream').JSStream)();
- 
- {
-   // Test that an old serialized value can still be deserialized.
--  const buf = Buffer.from('ff0d6f2203666f6f5e007b01', 'hex');
-+  const buf = Buffer.from('ff0f6f2203666f6f5e007b01', 'hex');
- 
-   const des = new v8.DefaultDeserializer(buf);
-   des.readHeader();
--  assert.strictEqual(des.getWireFormatVersion(), 0x0d);
-+  assert.strictEqual(des.getWireFormatVersion(), 0x0f);
- 
-   const value = des.readValue();
-   assert.strictEqual(value, value.foo);
-@@ -206,7 +206,7 @@ const hostObject = new (internalBinding('js_stream').JSStream)();
- {
-   // Unaligned Uint16Array read, with padding in the underlying array buffer.
-   let buf = Buffer.alloc(32 + 9);
--  buf.write('ff0d5c0404addeefbe', 32, 'hex');
-+  buf.write('ff0e5c0404addeefbe', 32, 'hex');
-   buf = buf.slice(32);
- 
-   const expectedResult = os.endianness() === 'LE' ?
Repository: facebook/react
Pull request: pull implementations from the right react-dom

should have imported from the stub implementation. this blew up the server rendering stub size (effectively pulling in the entire client bundle)

Changed files:
filename: packages/react-dom/server-rendering-stub.js
patch: @@ -30,7 +30,10 @@ export {
 } from './src/server/ReactDOMServerRenderingStub';
 
 import type {FormStatus} from 'react-dom-bindings/src/shared/ReactDOMFormActions';
-import {useFormStatus, useFormState} from './src/client/ReactDOM';
+import {
+  useFormStatus,
+  useFormState,
+} from './src/server/ReactDOMServerRenderingStub';
 
 export function experimental_useFormStatus(): FormStatus {
   if (__DEV__) {
Repository: facebook/react
Pull request: `react-dom/server-rendering-stub`: restore experimental prefix for `useFormState` and `useFormStatus`

in #27461 the experimental prefix was added back for `useFormState` and `useFormStatus` in react-dom. However these functions are also exported from the server rendering stub too and when using the stub with experimental prefixes their absence causes unexpected errors.

This change adds back the experimental prefix for these two hooks to match the experimental build of react-dom.

Changed files:
filename: packages/react-dom/server-rendering-stub.js
patch: @@ -28,3 +28,30 @@ export {
   useFormState,
   unstable_batchedUpdates,
 } from './src/server/ReactDOMServerRenderingStub';
+
+import type {FormStatus} from 'react-dom-bindings/src/shared/ReactDOMFormActions';
+import {useFormStatus, useFormState} from './src/client/ReactDOM';
+
+export function experimental_useFormStatus(): FormStatus {
+  if (__DEV__) {
+    console.error(
+      'useFormStatus is now in canary. Remove the experimental_ prefix. ' +
+        'The prefixed alias will be removed in an upcoming release.',
+    );
+  }
+  return useFormStatus();
+}
+
+export function experimental_useFormState<S, P>(
+  action: (S, P) => Promise<S>,
+  initialState: S,
+  permalink?: string,
+): [S, (P) => void] {
+  if (__DEV__) {
+    console.error(
+      'useFormState is now in canary. Remove the experimental_ prefix. ' +
+        'The prefixed alias will be removed in an upcoming release.',
+    );
+  }
+  return useFormState(action, initialState, permalink);
+}
Repository: electron/electron
Pull request: build: always use python3 in `script/lib/get-version.js`

Backport of #45400

See that PR for details.


Notes: none <!-- Please add a one-line description for app developers to read in the release notes, or 'none' if no notes relevant to app developers. Examples and help on special cases: https://github.com/electron/clerk/blob/main/README.md#examples -->


Changed files:
filename: .github/workflows/pipeline-segment-electron-test.yml
patch: @@ -74,6 +74,7 @@ jobs:
         echo "C:\Program Files\Git\cmd" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
         echo "C:\Program Files\Git\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
         echo "C:\Python311" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
+        cp "C:\Python311\python.exe" "C:\Python311\python3.exe"
     - name: Setup Node.js/npm
       if: ${{ inputs.target-platform == 'win' }}
       uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af

filename: script/lib/get-version.js
patch: @@ -19,10 +19,8 @@ module.exports.getElectronVersion = () => {
     // Error may happen when trying to get version before running gn, which is a
     // valid case and error will be ignored.
   }
-  // Most win32 machines have python.exe but no python3.exe.
-  const python = process.platform === 'win32' ? 'python.exe' : 'python3';
   // Get the version from git tag if it is not defined in gn args.
-  const output = spawnSync(python, [path.join(ELECTRON_DIR, 'script', 'get-git-version.py')]);
+  const output = spawnSync('python3', [path.join(ELECTRON_DIR, 'script', 'get-git-version.py')]);
   if (output.status !== 0) {
     throw new Error(`Failed to get git tag, script quit with ${output.status}: ${output.stdout}`);
   }
Repository: denoland/deno
Pull request: test(ext/http): reduce flakiness of serve_test

This PR reduces the flakiness of the case `req.body.getReader().read() throws the error with reasonable error message`.

The case tries to cause BadResource error by premature disconnection from the client, but it sometimes completes the request when the reading of tcp data happens quickly. This PR tries to prevent that scenario by adding some delays when reading & writing http messages.

Changed files:
filename: tests/unit/serve_test.ts
patch: @@ -4,6 +4,7 @@
 
 import { assertIsError, assertMatch, assertRejects } from "@std/assert";
 import { Buffer, type Reader } from "@std/io";
+import { delay } from "@std/async/delay";
 import { TextProtoReader } from "../testdata/run/textproto.ts";
 import {
   assert,
@@ -4327,6 +4328,7 @@ Deno.test({
 
     try {
       while (true) {
+        await delay(100);
         const { done } = await reader.read();
         if (done) break;
       }
@@ -4342,13 +4344,15 @@ Deno.test({
 
   async function onListen({ port }: { port: number }) {
     const body = "a".repeat(1000);
-    const request = `POST / HTTP/1.1\r\n` +
+    const header = `POST / HTTP/1.1\r\n` +
       `Host: 127.0.0.1:${port}\r\n` +
       `Content-Length: 1000\r\n` +
-      "\r\n" + body;
+      "\r\n";
 
     const connection = await Deno.connect({ hostname: "127.0.0.1", port });
-    await connection.write(new TextEncoder().encode(request));
+    await connection.write(new TextEncoder().encode(header));
+    await delay(100);
+    await connection.write(new TextEncoder().encode(body));
     connection.close();
   }
   await server.finished;
Repository: electron/electron
Pull request: build: always use python3 in `script/lib/get-version.js`

#### Description of Change

<!--
Thank you for your Pull Request. Please provide a description above and review
the requirements below.

Contributors guide: https://github.com/electron/electron/blob/main/CONTRIBUTING.md
-->

While the deleted comment is accurate, we use `python3` extensively throughout the rest of the build scripts, and more importantly `depot_tools` only ships with a `python3.bat` these days. The existing code causes building to fail on a fresh Windows machine if Python is not installed - otherwise the Python version bundled with `depot_tools` is used and works fine.

Required one minor tweak to the test pipeline segment for WOA to ensure `python3` can be found - I believe this is because `depot_tools` doesn't have an arm64 recipe for Python on Windows.

#### Checklist
<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

- [x] PR description included and stakeholders cc'd
- [x] `npm test` passes

#### Release Notes

Notes: none <!-- Please add a one-line description for app developers to read in the release notes, or 'none' if no notes relevant to app developers. Examples and help on special cases: https://github.com/electron/clerk/blob/main/README.md#examples -->


Changed files:
filename: .github/workflows/pipeline-segment-electron-test.yml
patch: @@ -74,6 +74,7 @@ jobs:
         echo "C:\Program Files\Git\cmd" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
         echo "C:\Program Files\Git\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
         echo "C:\Python311" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
+        cp "C:\Python311\python.exe" "C:\Python311\python3.exe"
     - name: Setup Node.js/npm
       if: ${{ inputs.target-platform == 'win' }}
       uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a

filename: script/lib/get-version.js
patch: @@ -19,10 +19,8 @@ module.exports.getElectronVersion = () => {
     // Error may happen when trying to get version before running gn, which is a
     // valid case and error will be ignored.
   }
-  // Most win32 machines have python.exe but no python3.exe.
-  const python = process.platform === 'win32' ? 'python.exe' : 'python3';
   // Get the version from git tag if it is not defined in gn args.
-  const output = spawnSync(python, [path.join(ELECTRON_DIR, 'script', 'get-git-version.py')]);
+  const output = spawnSync('python3', [path.join(ELECTRON_DIR, 'script', 'get-git-version.py')]);
   if (output.status !== 0) {
     throw new Error(`Failed to get git tag, script quit with ${output.status}: ${output.stdout}`);
   }
Repository: denoland/deno
Pull request: fix(ci): missing release symcache

Probably caused by copy-pasting from the canary upload job.


Changed files:
filename: .github/workflows/ci.generate.ts
patch: @@ -1047,7 +1047,7 @@ const ci = {
           run: [
             'gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.zip gs://dl.deno.land/release/${GITHUB_REF#refs/*/}/',
             'gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.sha256sum gs://dl.deno.land/release/${GITHUB_REF#refs/*/}/',
-            'gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.symcache gs://dl.deno.land/canary/$(git rev-parse HEAD)/',
+            'gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.symcache gs://dl.deno.land/release/${GITHUB_REF#refs/*/}/',
           ].join("\n"),
         },
         {
@@ -1065,7 +1065,7 @@ const ci = {
           run: [
             'gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.zip gs://dl.deno.land/release/${GITHUB_REF#refs/*/}/',
             'gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.sha256sum gs://dl.deno.land/release/${GITHUB_REF#refs/*/}/',
-            'gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.symcache gs://dl.deno.land/canary/$(git rev-parse HEAD)/',
+            'gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.symcache gs://dl.deno.land/release/${GITHUB_REF#refs/*/}/',
           ].join("\n"),
         },
         {

filename: .github/workflows/ci.yml
patch: @@ -650,7 +650,7 @@ jobs:
         run: |-
           gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.zip gs://dl.deno.land/release/${GITHUB_REF#refs/*/}/
           gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.sha256sum gs://dl.deno.land/release/${GITHUB_REF#refs/*/}/
-          gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.symcache gs://dl.deno.land/canary/$(git rev-parse HEAD)/
+          gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.symcache gs://dl.deno.land/release/${GITHUB_REF#refs/*/}/
       - name: Upload release to dl.deno.land (windows)
         if: |-
           !(matrix.skip) && (matrix.os == 'windows' &&
@@ -663,7 +663,7 @@ jobs:
         run: |-
           gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.zip gs://dl.deno.land/release/${GITHUB_REF#refs/*/}/
           gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.sha256sum gs://dl.deno.land/release/${GITHUB_REF#refs/*/}/
-          gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.symcache gs://dl.deno.land/canary/$(git rev-parse HEAD)/
+          gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.symcache gs://dl.deno.land/release/${GITHUB_REF#refs/*/}/
       - name: Create release notes
         if: |-
           !(matrix.skip) && (matrix.job == 'test' &&
Repository: facebook/react
Pull request: Reduce install network flake

## Summary

Avoids potentially flaky network calls leading to failures such as https://app.circleci.com/pipelines/github/facebook/react/47096/workflows/b7966c1d-199c-4185-8d17-ac6485235c3a/jobs/727782. Also makes install faster since we don't need the binary in CI seemingly.

Electron itself is used to start the standalone binary.

## How did you test this change?

- [x] CI still passes without the binary downloaded. I'm just trusting [their docs](https://www.electronjs.org/docs/latest/tutorial/installation) here that setting this actually ensures the binary isn't downloaded.


Changed files:
filename: .circleci/config.yml
patch: @@ -53,6 +53,9 @@ commands:
             if [ $? -ne 0 ]; then
               yarn install --frozen-lockfile --cache-folder ~/.cache/yarn
             fi
+          environment:
+          # If we start needing the Electron binary, please ensure the binary is cached in CI following https://www.electronjs.org/docs/latest/tutorial/installation
+            ELECTRON_SKIP_BINARY_DOWNLOAD: 1
       - save_cache:
           name: Save yarn cache
           key: v2-yarn_cache-{{ arch }}-{{ checksum "yarn.lock" }}