PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: mtarld/api-platform-ms-bundle (php)

Issue:
Wrong Accept header for patch requests
`Content-Type` and `Accept` headers are set to the same value for every request (see [GenericHttpClient::request](https://github.com/mtarld/api-platform-ms-bundle/blob/1.x/src/HttpClient/GenericHttpClient.php#L51-L61)). However the response to a `PATCH` request is in the default format (like `application/ld+json`) and not `application/merge-patch+json`. Combined this leads to a 406 status code error when the default format is not `jsonapi`.

The solution to this would be to use the default mime type set up for the microservice for the accept header. I could issue a PR if you don't mind.

Pull request:
Separate accept from content-type header for patch requests
Fixes #84

Patch:
diff --git a/src/HttpClient/GenericHttpClient.php b/src/HttpClient/GenericHttpClient.php
index d88fd53..956260b 100644
--- a/src/HttpClient/GenericHttpClient.php
+++ b/src/HttpClient/GenericHttpClient.php
@@ -48,14 +48,14 @@ class GenericHttpClient implements ReplaceableHttpClientInterface
      */
     public function request(Microservice $microservice, string $method, string $uri, mixed $body = null, ?string $mimeType = null, ?string $bodyFormat = null): ResponseInterface
     {
-        $defaultMimeType = 'PATCH' === $method ? self::PATCH_MIME_TYPES[$microservice->getFormat()] : self::MIME_TYPES[$microservice->getFormat()];
-        $mimeType ??= $defaultMimeType;
+        $mimeType ??= self::MIME_TYPES[$microservice->getFormat()];
+        $contentType = 'PATCH' === $method ? self::PATCH_MIME_TYPES[$microservice->getFormat()] : $mimeType;
         $bodyFormat ??= $microservice->getFormat();
 
         $options = [
             'base_uri' => $microservice->getBaseUri(),
             'headers' => [
-                'Content-Type' => $mimeType,
+                'Content-Type' => $contentType,
                 'Accept' => $mimeType,
             ],
         ];


Test patch:
diff --git a/tests/HttpRepository/HttpRepositoryTest.php b/tests/HttpRepository/HttpRepositoryTest.php
index fd22250..ba81d49 100644
--- a/tests/HttpRepository/HttpRepositoryTest.php
+++ b/tests/HttpRepository/HttpRepositoryTest.php
@@ -433,7 +433,7 @@ class HttpRepositoryTest extends KernelTestCase
                     'base_uri' => 'https://localhost',
                     'headers' => [
                         'Content-Type' => 'application/merge-patch+json',
-                        'Accept' => 'application/merge-patch+json',
+                        'Accept' => 'application/ld+json',
                     ],
                     'body' => '{"iri":"\/puppies\/1","super_name":"foo","color":null,"hairs":[]}',
                 ]
Repository: DirectoryTree/ImapEngine (php)

Issue:
Can't parse word with accent
Hello,

French developper here, i try to search word in subject like "Joué" : 
`$messages = $inbox->messages()->withHeaders()->withBody()->subject('Joué')->get();`

And get this ImapCommandException : 
`IMAP command "TAG4 UID SEARCH SUBJECT "Joué"" failed. Response: "TAG4 BAD Could not parse command"`

The search without word with accent work well like "Hello world" 👍 

**Environment**
- **PHP version:** 8.3
- **ImapEngine version:** 1.13.2
- **IMAP server:** Gmail

**IMAP logs**
2025-05-20 16:16:46: << TAG3 OK [READ-WRITE] INBOX selected. (Success)
2025-05-20 16:16:46: >> TAG4 UID SEARCH SUBJECT "Joué"
2025-05-20 16:16:47: << TAG4 BAD Could not parse command




Pull request:
Convert query values to UTF-7
Closes #69 

Patch:
diff --git a/src/Connection/ImapQueryBuilder.php b/src/Connection/ImapQueryBuilder.php
index facbea6..0054655 100644
--- a/src/Connection/ImapQueryBuilder.php
+++ b/src/Connection/ImapQueryBuilder.php
@@ -440,7 +440,7 @@ class ImapQueryBuilder
         if ($where['value'] instanceof RawQueryValue) {
             $part .= ' '.$where['value']->value;
         } elseif ($where['value']) {
-            $part .= ' "'.$where['value'].'"';
+            $part .= ' "'.Str::toImapUtf7($where['value']).'"';
         }
 
         if ($where['not']) {
diff --git a/src/FolderRepository.php b/src/FolderRepository.php
index d20419f..edd1a69 100644
--- a/src/FolderRepository.php
+++ b/src/FolderRepository.php
@@ -20,7 +20,7 @@ class FolderRepository implements FolderRepositoryInterface
      */
     public function find(string $path): ?FolderInterface
     {
-        return $this->get($path)->first();
+        return $this->get(Str::toImapUtf7($path))->first();
     }
 
     /**
@@ -28,7 +28,7 @@ class FolderRepository implements FolderRepositoryInterface
      */
     public function findOrFail(string $path): FolderInterface
     {
-        return $this->get($path)->firstOrFail();
+        return $this->get(Str::toImapUtf7($path))->firstOrFail();
     }
 
     /**


Test patch:
diff --git a/tests/Unit/Connection/ImapQueryBuilderTest.php b/tests/Unit/Connection/ImapQueryBuilderTest.php
index 8035f30..cd2760e 100644
--- a/tests/Unit/Connection/ImapQueryBuilderTest.php
+++ b/tests/Unit/Connection/ImapQueryBuilderTest.php
@@ -220,3 +220,11 @@ test('compiles raw value', function () {
 
     expect($builder->toImap())->toBe('FOO bar');
 });
+
+test('converts values from utf-8 to utf-7', function () {
+    $builder = new ImapQueryBuilder;
+
+    $builder->where('foo', 'Joué');
+
+    expect($builder->toImap())->toBe('FOO "Jou&AOk-"');
+});
Repository: yargs/yargs (js)

Issue:
options without description to not appear in --help
`yargs@7.0.2`

```js
#!/usr/bin/env node

// @flow

import yargs from 'yargs';
import passthroughService from './commands/passthroughService';

yargs
  .command(passthroughService)
  .option('logstash', {
    describe: 'Logstash host:port'
  })
  .help()
  .parse(process.argv.slice(1));

```

```js
// ./commands/passthroughService;

export default {
  builder: (yargs: Object) => {
    return yargs
      .options({
        forward: {
          type: 'string'
        },
        listen: {
          default: 'http://0.0.0.0:3000',
          type: 'string'
        }
      });
// [..]
```

```bash
$ babel-node src/bin/forwardProxy.js passthrough-service --help
Options:
  --logstash  Logstash host:port
  --help      Show help                                                [boolean]
  --listen                             [string] [default: "http://0.0.0.0:3000"]
```

Note the missing `forward` option.

Pull request:
fix: show hidden options in help
Options with `description: false` will now show up help

fixes #851

Patch:
diff --git a/yargs.js b/yargs.js
index 08569fc..21c4c9b 100644
--- a/yargs.js
+++ b/yargs.js
@@ -647,7 +647,7 @@ function Yargs (processArgs, cwd, parentRequire) {
       }
 
       const desc = opt.describe || opt.description || opt.desc
-      if (desc) {
+      if (!opt.hidden) {
         self.describe(key, desc)
       }
 


Test patch:
diff --git a/test/usage.js b/test/usage.js
index 78592e0..c97592a 100644
--- a/test/usage.js
+++ b/test/usage.js
@@ -2314,10 +2314,12 @@ describe('usage tests', () => {
       const r = checkUsage(() => yargs(['--help'])
           .option('answer', {
             type: 'string',
-            choices: ['yes', 'no', 'maybe']
+            choices: ['yes', 'no', 'maybe'],
+            hidden: true
           })
           .option('confidence', {
-            choices: [0, 25, 50, 75, 100]
+            choices: [0, 25, 50, 75, 100],
+            hidden: true
           })
           .wrap(null)
           .argv
@@ -2698,4 +2700,31 @@ describe('usage tests', () => {
       ])
     })
   })
+
+  describe('hidden options', () => {
+    it('--help should display all options except for hidden ones', () => {
+      const r = checkUsage(() => yargs('--help')
+          .options({
+            foo: {
+              describe: 'FOO'
+            },
+            bar: {},
+            baz: {
+              describe: 'BAZ',
+              hidden: true
+            }
+          })
+          .argv
+        )
+
+      r.logs[0].split('\n').should.deep.equal([
+        'Options:',
+        '  --help     Show help                                                 [boolean]',
+        '  --version  Show version number                                       [boolean]',
+        '  --foo      FOO',
+        '  --bar',
+        ''
+      ])
+    })
+  })
 })
Repository: blitz-js/superjson (ts)

Issue:
Error "Ambiguous class, provide a unique identifier" with next.js 10.0.6
We are having an issue with next.js 10.0.6 in Blitz where we get the `"Ambiguous class, provide a unique identifier"` error even though [all classes have unique ids](https://github.com/blitz-js/blitz/blob/canary/packages/core/src/errors.ts). 

👉  https://github.com/blitz-js/blitz/pull/1828/checks?check_run_id=1795588783#step:9:104

**Possible fix:** 

Disable this check, https://github.com/blitz-js/superjson/blob/main/src/registry.ts#L17, if you are explicitly providing an identifier.

Pull request:
Only check for ambiguous classes in development
Closes #106, #105 

Patch:
diff --git a/src/registry.ts b/src/registry.ts
index 07ea5af..4e867d2 100644
--- a/src/registry.ts
+++ b/src/registry.ts
@@ -14,8 +14,13 @@ export class Registry<T> {
       identifier = this.generateIdentifier(value);
     }
 
-    if (this.kv.getByKey(identifier)) {
-      throw new Error('Ambiguous class, provide a unique identifier.');
+    if (process.env.NODE_ENV !== 'production') {
+      const alreadyRegistered = this.kv.getByKey(identifier);
+      if (alreadyRegistered && alreadyRegistered !== value) {
+        console.warn(
+          `Ambiguous class "${identifier}", provide a unique identifier.`
+        );
+      }
     }
 
     this.kv.set(identifier, value);


Test patch:
diff --git a/src/registry.test.ts b/src/registry.test.ts
index 943a633..2124810 100644
--- a/src/registry.test.ts
+++ b/src/registry.test.ts
@@ -16,8 +16,11 @@ test('class registry', () => {
 
   expect(() => registry.register(Car)).not.toThrow();
 
-  expect(() => registry.register(class Car {})).toThrow(
-    'Ambiguous class, provide a unique identifier.'
+  const warnSpy = jest.spyOn(console, 'warn');
+
+  registry.register(class Car {});
+  expect(warnSpy).toHaveBeenCalledWith(
+    'Ambiguous class "Car", provide a unique identifier.'
   );
 
   registry.register(class Car {}, 'car2');
Repository: TanStack/router (ts)

Issue:
loader staleTime is NOT respected AFTER router invalidation
### Which project does this relate to?

Router

### Describe the bug

While doing a simple todo sample app, after I added a todo, I called router.invalidate() so that the loader would fire and get the new todo, but once invalidate is called once, it appears that all routes are forever in the `invalid: true` state and the loaders run over and over. This is very noticeable when you have `defaultPreload: "intent"` set.
 

### Your Example Website or App

https://stackblitz.com/edit/tanstack-router-8gggny?file=app%2Froutes%2Fposts.tsx

### Steps to Reproduce the Bug or Issue

1. Go to posts layout
2. Hover over the post links and see in the terminal that all the loaders are fired
3. Hover over the post links again, and you should see no loaders are fired
4. Click the button labeled "Click here to Invalidate Router"
5. Now hover over the links and you will see the loaders fire again, but the route is not marked as `invalid: false` so hovering/clicking over and over will fire the loader again and again.

### Expected behavior

I would expect after doing router.invalidate() that the route loaders would fire again, but only once since I have defaultStaleTime set to Infinity.

### Screenshots or Videos

https://github.com/user-attachments/assets/4a6c82d4-3ca4-45d4-8793-2b9ea7a3035d


### Platform

- OS: Windows & Stackblitz
- Browser: Chrome
- Version: 126


### Additional context

_No response_

Pull request:
fix(react-router): reset `invalid` status of route after loader ran again
fixes #2474

Patch:
diff --git a/packages/react-router/src/router.ts b/packages/react-router/src/router.ts
index e4e3e7907..8d7834852 100644
--- a/packages/react-router/src/router.ts
+++ b/packages/react-router/src/router.ts
@@ -2394,6 +2394,7 @@ export class Router<
                     ...prev,
                     isFetching: loaderRunningAsync ? prev.isFetching : false,
                     loaderPromise: undefined,
+                    invalid: false,
                   }))
                 })(),
               )


Test patch:
diff --git a/packages/react-router/tests/router.test.tsx b/packages/react-router/tests/router.test.tsx
index 29ebd08b7..5ec04873d 100644
--- a/packages/react-router/tests/router.test.tsx
+++ b/packages/react-router/tests/router.test.tsx
@@ -580,3 +580,29 @@ describe('router matches URLs to route definitions', () => {
     ])
   })
 })
+
+describe('invalidate', () => {
+  it('after router.invalid(), routes should be `valid` again after loading', async () => {
+    const { router } = createTestRouter(
+      createMemoryHistory({ initialEntries: ['/'] }),
+    )
+
+    await act(() => router.load())
+
+    router.state.matches.forEach((match) => {
+      expect(match.invalid).toBe(false)
+    })
+
+    await act(() => router.invalidate())
+
+    router.state.matches.forEach((match) => {
+      expect(match.invalid).toBe(false)
+    })
+
+    await act(() => router.load())
+
+    router.state.matches.forEach((match) => {
+      expect(match.invalid).toBe(false)
+    })
+  })
+})
Repository: vaskoz/dailycodingproblem-go (go)

Issue:
Day 305
Good morning! Here's your coding interview problem for today.

This problem was asked by Amazon.

Given a linked list, remove all consecutive nodes that sum to zero. Print out the remaining nodes.

For example, suppose you are given the input `3 -> 4 -> -7 -> 5 -> -6 -> 6`. In this case, you should first remove `3 -> 4 -> -7`, then `-6 -> 6`, leaving only `5`.

Pull request:
Day305
Resolves #622.

Patch:
diff --git a/README.md b/README.md
index 89aec29..951ef4d 100644
--- a/README.md
+++ b/README.md
@@ -311,3 +311,4 @@ problems from
 * [Day 302](https://github.com/vaskoz/dailycodingproblem-go/issues/615)
 * [Day 303](https://github.com/vaskoz/dailycodingproblem-go/issues/616)
 * [Day 304](https://github.com/vaskoz/dailycodingproblem-go/issues/618)
+* [Day 305](https://github.com/vaskoz/dailycodingproblem-go/issues/622)
diff --git a/day305/problem.go b/day305/problem.go
new file mode 100644
index 0000000..acbca9b
--- /dev/null
+++ b/day305/problem.go
@@ -0,0 +1,29 @@
+package day305
+
+// LL is a linked list of integers.
+type LL struct {
+	Value int
+	Next  *LL
+}
+
+// RemoveConsecutiveSumZero removes all sublists that sum to zero.
+// Runs in O(N^2) time and O(1) space.
+func RemoveConsecutiveSumZero(head *LL) *LL {
+	fakeHead := &LL{0, head}
+	for start := fakeHead; start != nil; start = start.Next {
+		var sum int
+		var farthest *LL
+		var found bool
+		for next := start.Next; next != nil; next = next.Next {
+			sum += next.Value
+			if sum == 0 {
+				farthest = next.Next
+				found = true
+			}
+		}
+		if found {
+			start.Next = farthest
+		}
+	}
+	return fakeHead.Next
+}


Test patch:
diff --git a/day305/problem_test.go b/day305/problem_test.go
new file mode 100644
index 0000000..48122d6
--- /dev/null
+++ b/day305/problem_test.go
@@ -0,0 +1,57 @@
+package day305
+
+import "testing"
+
+// nolint
+var testcases = []struct {
+	input, expected *LL
+}{
+	{
+		&LL{3, &LL{4, &LL{-7, &LL{5, &LL{-6, &LL{6, nil}}}}}},
+		&LL{5, nil},
+	},
+	{
+		&LL{3, &LL{4, &LL{5, &LL{-12, nil}}}},
+		nil,
+	},
+	{
+		&LL{3, &LL{4, &LL{-7, &LL{5, &LL{-5, &LL{6, nil}}}}}},
+		&LL{6, nil},
+	},
+	{
+		&LL{3, &LL{4, &LL{-7, &LL{3, &LL{5, &LL{-6, &LL{6, &LL{-5, nil}}}}}}}},
+		&LL{3, nil},
+	},
+	{
+		&LL{1, &LL{1, &LL{2, &LL{3, &LL{4, &LL{5, &LL{6, &LL{-5, nil}}}}}}}},
+		&LL{1, &LL{1, &LL{2, &LL{3, &LL{4, &LL{5, &LL{6, &LL{-5, nil}}}}}}}},
+	},
+}
+
+func equal(a, b *LL) bool {
+	for a != nil && b != nil {
+		if a.Value != b.Value {
+			return false
+		}
+		a = a.Next
+		b = b.Next
+	}
+	return a == nil && b == nil
+}
+
+func TestRemoveConsecutiveSumZero(t *testing.T) {
+	t.Parallel()
+	for tcid, tc := range testcases {
+		if result := RemoveConsecutiveSumZero(tc.input); !equal(result, tc.expected) {
+			t.Errorf("TCID%d doesn't match", tcid)
+		}
+	}
+}
+
+func BenchmarkRemoveConsecutiveSumZero(b *testing.B) {
+	for i := 0; i < b.N; i++ {
+		for _, tc := range testcases {
+			RemoveConsecutiveSumZero(tc.input)
+		}
+	}
+}