helloadhavan/github_issues huggingface dataset:
Repository: electron/electron
Pull request: fix: remove menu observer before destroying menu_controller_

Backport of #49648

See that PR for details.


Notes: Fixed an application crash on MacOS where the menu observer was not being properly removed before garbage collection.

Changed files:
filename: shell/browser/api/electron_api_menu.cc
patch: @@ -68,6 +68,10 @@ Menu::Menu(gin::Arguments* args)
 }
 
 Menu::~Menu() {
+  RemoveModelObserver();
+}
+
+void Menu::RemoveModelObserver() {
   if (model_) {
     model_->RemoveObserver(this);
   }

filename: shell/browser/api/electron_api_menu.h
patch: @@ -61,6 +61,10 @@ class Menu : public gin::Wrappable<Menu>,
   ElectronMenuModel* model() const { return model_.get(); }
 
  protected:
+  // Remove this instance as an observer from the model. Called by derived
+  // class destructors to ensure observer is removed before platform-specific
+  // cleanup that may trigger model callbacks.
+  void RemoveModelObserver();
   // Returns a new callback which keeps references of the JS wrapper until the
   // passed |callback| is called.
   base::OnceClosure BindSelfToClosure(base::OnceClosure callback);

filename: shell/browser/api/electron_api_menu_mac.mm
patch: @@ -51,7 +51,11 @@
 
 MenuMac::MenuMac(gin::Arguments* args) : Menu{args} {}
 
-MenuMac::~MenuMac() = default;
+MenuMac::~MenuMac() {
+  // Must remove observer before destroying menu_controller_, which holds
+  // a weak reference to model_
+  RemoveModelObserver();
+}
 
 void MenuMac::PopupAt(BaseWindow* window,
                       std::optional<WebFrameMain*> frame,
Repository: vuejs/vue
Pull request: a spelling mistake

<!--
Please make sure to read the Pull Request Guidelines:
https://github.com/vuejs/vue/blob/dev/.github/CONTRIBUTING.md#pull-request-guidelines
-->

<!-- PULL REQUEST TEMPLATE -->
<!-- (Update "[ ]" to "[x]" to check a box) -->

**What kind of change does this PR introduce?** (check at least one)

- [ ] Bugfix
- [ ] Feature
- [ ] Code style update
- [ ] Refactor
- [ ] Build-related changes
- [x] Other, please describe: spelling mistake

**Does this PR introduce a breaking change?** (check one)

- [ ] Yes
- [x] No

If yes, please describe the impact and migration path for existing applications:

**The PR fulfills these requirements:**

- [ ] It's submitted to the `dev` branch for v2.x (or to a previous version branch), _not_ the `master` branch
- [ ] When resolving a specific issue, it's referenced in the PR's title (e.g. `fix #xxx[,#xxx]`, where "xxx" is the issue number)
- [ ] All tests are passing: https://github.com/vuejs/vue/blob/dev/.github/CONTRIBUTING.md#development-setup
- [ ] New/updated tests are included

If adding a **new feature**, the PR's description includes:
- [ ] A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

**Other information:**


Changed files:
filename: src/compiler/error-detector.js
patch: @@ -57,9 +57,9 @@ function checkNode (node: ASTNode, warn: Function) {
 }
 
 function checkEvent (exp: string, text: string, warn: Function, range?: Range) {
-  const stipped = exp.replace(stripStringRE, '')
-  const keywordMatch: any = stipped.match(unaryOperatorsRE)
-  if (keywordMatch && stipped.charAt(keywordMatch.index - 1) !== '$') {
+  const stripped = exp.replace(stripStringRE, '')
+  const keywordMatch: any = stripped.match(unaryOperatorsRE)
+  if (keywordMatch && stripped.charAt(keywordMatch.index - 1) !== '$') {
     warn(
       `avoid using JavaScript unary operator as property name: ` +
       `"${keywordMatch[0]}" in expression ${text.trim()}`,
Repository: ggml-org/llama.cpp
Pull request: server : fix ctx checkpoint invalidation

fix #20532

We must not keep checkpoints that contain tokens with position beyond the position that we are about to generate next. This bug has been present for a while and mostly affects SWA models such as `gpt-oss`.

Changed files:
filename: tools/server/server-context.cpp
patch: @@ -2402,11 +2402,11 @@ struct server_context_impl {
                             }
 
                             {
-                                // erase any checkpoints with pos_min > pos_min_thold
+                                // erase any checkpoints with pos_max > pos_next
                                 for (auto it = slot.prompt.checkpoints.begin(); it != slot.prompt.checkpoints.end();) {
                                     const auto & cur = *it;
-                                    if (cur.pos_min > pos_min_thold) {
-                                        SLT_WRN(slot, "erased invalidated context checkpoint (pos_min = %d, pos_max = %d, n_tokens = %" PRId64 ", n_swa = %d, size = %.3f MiB)\n", cur.pos_min, cur.pos_max, cur.n_tokens, n_swa, (float) cur.data.size() / 1024 / 1024);
+                                    if (cur.pos_max > pos_next) {
+                                        SLT_WRN(slot, "erased invalidated context checkpoint (pos_min = %d, pos_max = %d, n_tokens = %" PRId64 ", n_swa = %d, pos_next = %d, size = %.3f MiB)\n", cur.pos_min, cur.pos_max, cur.n_tokens, n_swa, pos_next, (float) cur.data.size() / 1024 / 1024);
                                         it = slot.prompt.checkpoints.erase(it);
                                     } else {
                                         ++it;
Repository: nodejs/node
Pull request: test: check new WebCryptoAPI enum values

While KeyUsage values are tested indirectly through existing tests, the `raw-private` value is not supported by any of the existing algorithms and as such this test change ensures that `raw-private` is a recognized KeyFormat value.

Changed files:
filename: test/parallel/test-webcrypto-webidl.js
patch: @@ -238,7 +238,16 @@ const opts = { prefix, context };
 
 // KeyFormat
 {
-  for (const good of ['jwk', 'spki', 'pkcs8', 'raw']) {
+  for (const good of [
+    'jwk',
+    'spki',
+    'pkcs8',
+    'raw',
+    'raw-public',
+    'raw-seed',
+    'raw-secret',
+    'raw-private',
+  ]) {
     assert.strictEqual(converters.KeyFormat(good), good);
   }
 
@@ -262,6 +271,10 @@ const opts = { prefix, context };
     'deriveBits',
     'wrapKey',
     'unwrapKey',
+    'encapsulateBits',
+    'decapsulateBits',
+    'encapsulateKey',
+    'decapsulateKey',
   ]) {
     assert.strictEqual(converters.KeyUsage(good), good);
   }
Repository: vuejs/vue
Pull request: [automated] Patreon backers update (Aug 2019

This is an automated pull request.

Changed files:
filename: BACKERS.md
patch: @@ -341,93 +341,88 @@ Funds donated via Patreon go directly to support Evan You's full-time work on Vu
 - Shawn Wildermuth
 - Samuel Smith
 - donny
-- Sean Washington
 - Lars Andreas Ness
+- Sean Washington
 - Keisuke Kita
 - Benjamin Listwon
 - Kirk Lewis
-- Wen-Tien Chang
 - Stephen Michael Hartley
+- Wen-Tien Chang
 - Victor Tolbert
 - Phan An
 - James J. Ye
 - Barbara Liau
 - Luiz
 - Matsumoto Takamasa
-- Matt Jones
+- Guy Gavergun
 - Duncan Kenzie
 - Niannian Modisette
-- Guy Gavergun
+- Matt Jones
 - Bernhard E. Reiter
 - Zoran Knezevic
 - Jon Hobbs-Smith
 - Pierre Vanhulst
-- Anthony Estebe
-- Asaf Yishai
 - Haim Yulzari
+- Asaf Yishai
+- Anthony Estebe
 - Akiho Nagao
 - Jeremy Tan
 - Jim Raden
 - IMGNRY
 - Tyler
-- Daniel Waghorn
 - Guilherme S L de Souza
+- Daniel Waghorn
+- Mickaël Andrieu
+- Vivekanandhan Natarajan
 - Rob Yedlin
 - Rafael Belvederese
-- Vivekanandhan Natarajan
-- Mickaël Andrieu
-- Joe Gregory
 - Jordan Oroshiba
+- Joe Gregory
 - Marcos Moura
 - Jessie Hernandez
 - Eric
 - Ivan Sieder
 - Christo Crampton
 - Romain Lienard
 - Bohdan Kokotko
-- Alexander Weiher
-- Jere Sjöroos
 - Donald Fischer
-- Wakana Seki
 - Oskar Lindgren
+- Alexander Weiher
 - David Ang
+- Wakana Seki
+- Jere Sjöroos
+- Ben Hong
 - David Kaplan
 - Domenico Gaudioso
 - Jaeyoung Lee
-- Ben Hong
 - Andy
 - Matt Sencenbaugh
-- Joe Cochran
-- Juan Bermudez
-- Alberto T. Payero Mota
+- Shapovalov Pavel
 - Hannes Kochniß
-- Chris Calo
 - Daniel Mattingley
 - Elon Hung
+- Chris Calo
+- Juan Bermudez
 - Soichiro Isshiki
-- Shapovalov Pavel
-- Garion Herman
 - Ed Linklater
-- Andrew Willis
-- Yusuke Kawabata
+- Garion Herman
 - Princeyesuraj Edward
-- 极 蔡
+- Yusuke Kawabata
+- 龙腾道
 - Peter Matkovsky
 - Nick Dandakis
-- 龙腾道
-- Masato Miura
 - Fabien GuySake Ungerer
-- Fedor Indutny
-- Kenneth Crawford
-- Bill Condo
 - Nathan Mallison
+- Bill Condo
+- Kenneth Crawford
 - Pierre Lebrun
 - John Thompson
-- panmenghan
-- Jan-Philipp Schmeißer
 - Martin Bastien
 - Ryan Brewer
+- Merott Movahedi
 - Bichinger Software & Consulting
+- Alfonso Herrera
+- Abhay
 <!--10 end-->
 
 <h2 align="center">Backers via OpenCollective</h2>
Repository: ollama/ollama
Pull request: Comment fix: ImageData expecting image bytes (not base64 encoded)

Referring to the comment, I tried to provide base64 encoded image data but it didn't work. It seems that ImageData actually expect raw image bytes.

Changed files:
filename: api/types.go
patch: @@ -76,7 +76,7 @@ type GenerateRequest struct {
 	// this request.
 	KeepAlive *Duration `json:"keep_alive,omitempty"`
 
-	// Images is an optional list of base64-encoded images accompanying this
+	// Images is an optional list of raw image bytes accompanying this
 	// request, for multimodal models.
 	Images []ImageData `json:"images,omitempty"`
Repository: electron/electron
Pull request: fix: remove menu observer before destroying menu_controller_

#### Description of Change

Follow up to https://github.com/electron/electron/pull/48351

A previous refactor uncovered a long-standing bug in `MenuMac::~MenuMac() `'s lifetime cycle: When `MenuMac::~MenuMac()` was being destroyed by GC, during implicit destruction of `menu_controller_`, it could trigger callbacks to the model through observer notifications. `Menu::~Menu()` ran after, removing the observer too late.

This PR moves the observer cleanup from `Menu::~Menu()` to `MenuMac::~MenuMac()`, removing the observer before `menu_controller_` is destroyed and preventing callbacks during the deallocation.  

#### Checklist
<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

- [x] PR description included
- [x] I have built and tested this PR
- [x] `npm test` passes
- [x] tests are [changed or added](https://github.com/electron/electron/blob/main/docs/development/testing.md)
- [x] relevant API documentation, tutorials, and examples are updated and follow the [documentation style guide](https://github.com/electron/electron/blob/main/docs/development/style-guide.md)
- [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: Fixed an application crash on MacOS where the menu observer was not being properly removed before garbage collection.

Changed files:
filename: shell/browser/api/electron_api_menu.cc
patch: @@ -68,6 +68,10 @@ Menu::Menu(gin::Arguments* args)
 }
 
 Menu::~Menu() {
+  RemoveModelObserver();
+}
+
+void Menu::RemoveModelObserver() {
   if (model_) {
     model_->RemoveObserver(this);
   }

filename: shell/browser/api/electron_api_menu.h
patch: @@ -61,6 +61,10 @@ class Menu : public gin::Wrappable<Menu>,
   ElectronMenuModel* model() const { return model_.get(); }
 
  protected:
+  // Remove this instance as an observer from the model. Called by derived
+  // class destructors to ensure observer is removed before platform-specific
+  // cleanup that may trigger model callbacks.
+  void RemoveModelObserver();
   // Returns a new callback which keeps references of the JS wrapper until the
   // passed |callback| is called.
   base::OnceClosure BindSelfToClosure(base::OnceClosure callback);

filename: shell/browser/api/electron_api_menu_mac.mm
patch: @@ -51,7 +51,11 @@
 
 MenuMac::MenuMac(gin::Arguments* args) : Menu{args} {}
 
-MenuMac::~MenuMac() = default;
+MenuMac::~MenuMac() {
+  // Must remove observer before destroying menu_controller_, which holds
+  // a weak reference to model_
+  RemoveModelObserver();
+}
 
 void MenuMac::PopupAt(BaseWindow* window,
                       std::optional<WebFrameMain*> frame,
Repository: vercel/next.js
Pull request: Turbopack: fix Scope holding Arc too long

### What?

Turbo tasks Arc should be dropped before returning to the caller

Changed files:
filename: turbopack/crates/turbo-tasks/src/scope.rs
patch: @@ -195,8 +195,17 @@ impl<'scope, 'env: 'scope, R: Send + 'env> Scope<'scope, 'env, R> {
         assert!(index < self.results.len(), "Too many tasks spawned");
         let result_cell: &Mutex<Option<R>> = &self.results[index];
 
+        let turbo_tasks = self.turbo_tasks.clone();
         let f: Box<dyn FnOnce() + Send + 'scope> = Box::new(|| {
-            let result = f();
+            let result = {
+                if let Some(turbo_tasks) = turbo_tasks {
+                    // Ensure that the turbo tasks context is maintained across the job.
+                    turbo_tasks_scope(turbo_tasks, f)
+                } else {
+                    // If no turbo tasks context is available, just run the job.
+                    f()
+                }
+            };
             *result_cell.lock() = Some(result);
         });
         let f: *mut (dyn FnOnce() + Send + 'scope) = Box::into_raw(f);
@@ -210,7 +219,6 @@ impl<'scope, 'env: 'scope, R: Send + 'env> Scope<'scope, 'env, R> {
         // SAFETY: We just called `Box::into_raw`.
         let f = unsafe { Box::from_raw(f) };
 
-        let turbo_tasks = self.turbo_tasks.clone();
         let span = self.span.clone();
 
         self.inner.remaining_tasks.fetch_add(1, Ordering::Relaxed);
@@ -223,15 +231,7 @@ impl<'scope, 'env: 'scope, R: Send + 'env> Scope<'scope, 'env, R> {
             // Spawn a worker task that will process that tasks and potentially more.
             self.handle.spawn(async move {
                 let _span = span.entered();
-                if let Some(turbo_tasks) = turbo_tasks {
-                    // Ensure that the turbo tasks context is maintained across the worker.
-                    turbo_tasks_scope(turbo_tasks, || {
-                        inner.worker(index, f);
-                    });
-                } else {
-                    // If no turbo tasks context is available, just run the worker.
-                    inner.worker(index, f);
-                }
+                inner.worker(index, f);
             });
         } else {
             // Queue the task to be processed by a worker task.
Repository: vuejs/vue
Pull request: [automated] Patreon sponsors update

This is an automated pull request.

Changed files:
filename: BACKERS.md
patch: @@ -214,6 +214,11 @@ Funds donated via Patreon go directly to support Evan You's full-time work on Vu
           <img width="148px" src="https://raw.githubusercontent.com/vuejs/vuejs.org/master/themes/vue/source/images/daily.png">
         </a>
       </td>
+      <td align="center" valign="middle">
+        <a href="https://storekit.com" target="_blank">
+          <img width="148px" src="https://raw.githubusercontent.com/vuejs/vuejs.org/master/themes/vue/source/images/storekit.png">
+        </a>
+      </td>
     </tr><tr></tr>
   </tbody>
 </table>

filename: README.md
patch: @@ -219,6 +219,11 @@ Funds donated via Patreon go directly to support Evan You's full-time work on Vu
           <img width="148px" src="https://raw.githubusercontent.com/vuejs/vuejs.org/master/themes/vue/source/images/daily.png">
         </a>
       </td>
+      <td align="center" valign="middle">
+        <a href="https://storekit.com" target="_blank">
+          <img width="148px" src="https://raw.githubusercontent.com/vuejs/vuejs.org/master/themes/vue/source/images/storekit.png">
+        </a>
+      </td>
     </tr><tr></tr>
   </tbody>
 </table>
Repository: electron/electron
Pull request: fix: menu state in macOS dock menus

Backport of #49574

See that PR for details.


Notes: Fixed dock menu items not respecting enabled and checked properties on macOS.


Changed files:
filename: shell/browser/mac/electron_application_delegate.mm
patch: @@ -109,7 +109,14 @@ - (void)applicationDidResignActive:(NSNotification*)notification {
 }
 
 - (NSMenu*)applicationDockMenu:(NSApplication*)sender {
-  return menu_controller_ ? menu_controller_.menu : nil;
+  if (!menu_controller_)
+    return nil;
+
+  // Manually refresh menu state since menuWillOpen: is not called
+  // by macOS for dock menus for some reason before they are displayed.
+  NSMenu* menu = menu_controller_.menu;
+  [menu_controller_ refreshMenuTree:menu];
+  return menu;
 }
 
 - (BOOL)application:(NSApplication*)sender openFile:(NSString*)filename {

filename: shell/browser/ui/cocoa/electron_menu_controller.h
patch: @@ -57,6 +57,10 @@ class ElectronMenuModel;
 // Whether the menu is currently open.
 - (BOOL)isMenuOpen;
 
+// Recursively refreshes the menu tree starting from |menu|, applying the
+// model state (enabled, checked, hidden etc) to each menu item.
+- (void)refreshMenuTree:(NSMenu*)menu;
+
 // NSMenuDelegate methods this class implements. Subclasses should call super
 // if extending the behavior.
 - (void)menuWillOpen:(NSMenu*)menu;

filename: shell/browser/ui/cocoa/electron_menu_controller.mm
patch: @@ -490,8 +490,6 @@ - (void)applyStateToMenuItem:(NSMenuItem*)item {
                                              : NSControlStateValueOff;
 }
 
-// Recursively refreshes the menu tree starting from |menu|, applying the
-// model state to each menu item.
 - (void)refreshMenuTree:(NSMenu*)menu {
   for (NSMenuItem* item in menu.itemArray) {
     [self applyStateToMenuItem:item];
Repository: vercel/next.js
Pull request: Add dedicated commands to run tests with experimental config

Adds 
```
pnpm test-dev-experimental
pnpm test-dev-experimental-turbo
pnpm test-dev-experimental-rspack
pnpm test-start-experimental
pnpm test-start-experimental-turbo
pnpm test-start-experimental-rspack
```

Changed files:
filename: package.json
patch: @@ -18,11 +18,17 @@
     "test-types": "tsc",
     "test-unit": "jest test/unit/ packages/next/ packages/font",
     "test-dev": "cross-env NEXT_TEST_MODE=dev pnpm testheadless",
+    "test-dev-experimental": "cross-env NEXT_TEST_MODE=dev pnpm run with-experimental pnpm testheadless",
     "test-dev-rspack": "pnpm run with-rspack pnpm run test-dev",
+    "test-dev-experimental-rspack": "pnpm run with-rspack pnpm run test-dev-experimental",
     "test-dev-turbo": "cross-env NEXT_TEST_MODE=dev IS_TURBOPACK_TEST=1 TURBOPACK_DEV=1 pnpm testheadless",
+    "test-dev-experimental-turbo": "cross-env NEXT_TEST_MODE=dev IS_TURBOPACK_TEST=1 TURBOPACK_DEV=1 pnpm run with-experimental pnpm testheadless",
     "test-start": "cross-env NEXT_TEST_MODE=start pnpm testheadless",
+    "test-start-experimental": "cross-env NEXT_TEST_MODE=start pnpm run with-experimental pnpm testheadless",
     "test-start-rspack": "pnpm run with-rspack pnpm run test-start",
+    "test-start-experimental-rspack": "pnpm run with-rspack pnpm run test-start-experimental",
     "test-start-turbo": "cross-env NEXT_TEST_MODE=start IS_TURBOPACK_TEST=1 TURBOPACK_BUILD=1 pnpm testheadless",
+    "test-start-experimental-turbo": "cross-env NEXT_TEST_MODE=start IS_TURBOPACK_TEST=1 TURBOPACK_BUILD=1 pnpm run with-experimental pnpm testheadless",
     "test-deploy": "cross-env NEXT_TEST_MODE=deploy pnpm testheadless",
     "testonly-dev": "cross-env NEXT_TEST_MODE=dev pnpm testonly",
     "testonly-dev-rspack": "pnpm run with-rspack pnpm run testonly-dev",
@@ -82,7 +88,8 @@
     "storybook": "turbo run storybook",
     "build-storybook": "turbo run build-storybook",
     "test-storybook": "turbo run test-storybook",
-    "with-rspack": "cross-env NEXT_RSPACK=1 NEXT_TEST_USE_RSPACK=1"
+    "with-rspack": "cross-env NEXT_RSPACK=1 NEXT_TEST_USE_RSPACK=1",
+    "with-experimental": "cross-env __NEXT_EXPERIMENTAL_CACHE_COMPONENTS=true __NEXT_EXPERIMENTAL_PPR=true"
   },
   "devDependencies": {
     "@actions/core": "1.10.1",
Repository: ggml-org/llama.cpp
Pull request: Support refusal content for Responses API

Fixes #20280 (at least I hope so)

Changed files:
filename: tools/server/server-common.cpp
patch: @@ -1273,17 +1273,27 @@ json convert_responses_to_chatcmpl(const json & response_body) {
 
                 for (const auto & output_text : item.at("content")) {
                     const std::string type = json_value(output_text, "type", std::string());
-                    if (type != "output_text") {
-                        throw std::invalid_argument("'type' must be 'output_text'");
-                    }
-                    if (!exists_and_is_string(output_text, "text")) {
-                        throw std::invalid_argument("'Output text' requires 'text'");
+                    if (type == "output_text") {
+                        if (!exists_and_is_string(output_text, "text")) {
+                            throw std::invalid_argument("'Output text' requires 'text'");
+                            // Ignore annotations and logprobs for now
+                            chatcmpl_content.push_back({
+                                {"text", output_text.at("text")},
+                                {"type", "text"},
+                            });
+                        }
+                    } else if (type == "refusal") {
+                        if (!exists_and_is_string(output_text, "refusal")) {
+                            throw std::invalid_argument("'Refusal' requires 'refusal'");
+                            // Ignore annotations and logprobs for now
+                            chatcmpl_content.push_back({
+                                {"refusal", output_text.at("refusal")},
+                                {"type", "refusal"},
+                            });
+                        }
+                    } else {
+                        throw std::invalid_argument("'type' must be one of 'output_text' or 'refusal'");
                     }
-                    // Ignore annotations and logprobs for now
-                    chatcmpl_content.push_back({
-                        {"text", output_text.at("text")},
-                        {"type", "text"},
-                    });
                 }
 
                 if (merge_prev) {