PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: tradingview/lightweight-charts (ts)

Issue:
`Delegate.unsubscribeAll` method works in opposite way
### Discussed in https://github.com/tradingview/lightweight-charts/discussions/994

<div type='discussions-op-text'>

<sup>Originally posted by **zaleGZL** January 31, 2022</sup>
https://github.com/tradingview/lightweight-charts/blob/1d49f27ce7aa130ae0579dfdbb4ee2b7494c6c4e/src/helpers/delegate.ts#L30

should listener.linkedObject !== linkedObject  ?</div>

Pull request:
fix: Delegate.unsubscribeAll method works in opposite way #995
**Type of PR:** bugfix

Fixes #995



Patch:
diff --git a/src/helpers/delegate.ts b/src/helpers/delegate.ts
index 0f3384c42..e0953dded 100644
--- a/src/helpers/delegate.ts
+++ b/src/helpers/delegate.ts
@@ -27,7 +27,7 @@ export class Delegate<T1 = void, T2 = void> implements ISubscription<T1, T2> {
 	}
 
 	public unsubscribeAll(linkedObject: unknown): void {
-		this._listeners = this._listeners.filter((listener: Listener<T1, T2>) => listener.linkedObject === linkedObject);
+		this._listeners = this._listeners.filter((listener: Listener<T1, T2>) => listener.linkedObject !== linkedObject);
 	}
 
 	public fire(param1: T1, param2: T2): void {


Test patch:
diff --git a/tests/unittests/delegate.spec.ts b/tests/unittests/delegate.spec.ts
new file mode 100644
index 000000000..46fb4a912
--- /dev/null
+++ b/tests/unittests/delegate.spec.ts
@@ -0,0 +1,21 @@
+import { expect } from 'chai';
+import { describe, it } from 'mocha';
+
+import { Delegate } from '../../src/helpers/delegate';
+
+describe('Delegate', () => {
+	it('unsubscribeAll', () => {
+		const linkedObjectOne = {};
+		const linkedObjectTwo = {};
+		const eventDelegate: Delegate = new Delegate();
+		eventDelegate.subscribe(() => {}, linkedObjectOne);
+
+		expect(eventDelegate.hasListeners()).to.be.equal(true);
+
+		eventDelegate.unsubscribeAll(linkedObjectTwo);
+		expect(eventDelegate.hasListeners()).to.be.equal(true);
+
+		eventDelegate.unsubscribeAll(linkedObjectOne);
+		expect(eventDelegate.hasListeners()).to.be.equal(false);
+	});
+});
Repository: apple/swift-syntax (swift)

Issue:
Prefer the first lexical error in a string literal segment
### Description

In `lexInStringLiteral` we currently overwrite the current lexer error when evaluating the result of `lexCharacterInStringLiteral`, we ought to only overwrite if the error isn't already present such that we prefer the first lexical error.

### Steps to Reproduce

_No response_

Pull request:
Resolves: #1480

Patch:
diff --git a/Sources/SwiftParser/Lexer/Cursor.swift b/Sources/SwiftParser/Lexer/Cursor.swift
index 6497ac19456..40a645af84d 100644
--- a/Sources/SwiftParser/Lexer/Cursor.swift
+++ b/Sources/SwiftParser/Lexer/Cursor.swift
@@ -1913,7 +1913,10 @@ extension Lexer.Cursor {
           return Lexer.Result(.stringSegment, error: error)
         }
       case .error(let errorKind):
-        error = LexingDiagnostic(errorKind, position: self)
+        // Only overwrite error if we had not found an earlier error yet
+        if error == nil {
+          error = LexingDiagnostic(errorKind, position: self)
+        }
         self = clone
       case .endOfString:
         return Lexer.Result(


Test patch:
diff --git a/Tests/SwiftParserTest/ExpressionTests.swift b/Tests/SwiftParserTest/ExpressionTests.swift
index 17c6fbf026e..007bcc55f8a 100644
--- a/Tests/SwiftParserTest/ExpressionTests.swift
+++ b/Tests/SwiftParserTest/ExpressionTests.swift
@@ -611,6 +611,13 @@ final class ExpressionTests: XCTestCase {
         DiagnosticSpec(locationMarker: "2️⃣", message: #"expected '"' to end string literal"#, fixIts: [#"insert '"'"#]),
       ]
     )
+
+    assertParse(
+      ###""1️⃣\1 \1""###,
+      diagnostics: [
+        DiagnosticSpec(message: "invalid escape sequence in literal")
+      ]
+    )
   }
 
   func testAdjacentRawStringLiterals() {
Repository: aws/aws-sdk-js (js)

Issue:
getSignedUrl is broken in version 2.382.0
I've gotten the latest version of the SDK - which right now is 2.382.0 - and I'm experiencing an issue with *getSignedUrl*. The method always returns:

https://s3.us-east-2.amazonaws.com/

... no matter what. When I downgrade back to ^2.381.0, I have no problems.

Thanks,
Andrew



Pull request:
make credentials provider chain resolves synchronously
<!--
Thank you for your pull request. Please provide a description below.
-->
fix #2455 

@srchase 

##### Checklist
<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

- [x] `npm run test` passes
- [x] changelog is added, `npm run add-change`


Patch:
diff --git a/.changes/next-release/bugfix-credentials-3d679332.json b/.changes/next-release/bugfix-credentials-3d679332.json
new file mode 100644
index 000000000..1247916b3
--- /dev/null
+++ b/.changes/next-release/bugfix-credentials-3d679332.json
@@ -0,0 +1,5 @@
+{
+  "type": "bugfix",
+  "category": "credentials",
+  "description": "Make CredentialProviderChain coalesce resolvation synchronous"
+}
\ No newline at end of file
diff --git a/lib/credentials/credential_provider_chain.js b/lib/credentials/credential_provider_chain.js
index ff7d4925a..2f50ff771 100644
--- a/lib/credentials/credential_provider_chain.js
+++ b/lib/credentials/credential_provider_chain.js
@@ -108,9 +108,7 @@ AWS.CredentialProviderChain = AWS.util.inherit(AWS.Credentials, {
       function resolveNext(err, creds) {
         if ((!err && creds) || index === providers.length) {
           AWS.util.arrayEach(self.resolveCallbacks, function (callback) {
-            AWS.util.defer(function () {
-              callback(err, creds);
-            });
+            callback(err, creds);
           });
           self.resolveCallbacks.length = 0;
           return;


Test patch:
diff --git a/test/credential_provider_chain.spec.js b/test/credential_provider_chain.spec.js
index 53f954a38..a9ccc6211 100644
--- a/test/credential_provider_chain.spec.js
+++ b/test/credential_provider_chain.spec.js
@@ -53,6 +53,18 @@
             return expect(creds.sessionToken).to.equal('session');
           });
         });
+        it('should be able to resolve credentials synchronously', function() {
+          process.env['AMAZON_ACCESS_KEY_ID'] = 'akid';
+          process.env['AMAZON_SECRET_ACCESS_KEY'] = 'secret';
+          process.env['AMAZON_SESSION_TOKEN'] = 'session';
+          var credentials = null;
+          chain.resolve(function(err, creds) {
+            credentials = creds;
+          });
+          expect(credentials.accessKeyId).to.equal('akid');
+          expect(credentials.secretAccessKey).to.equal('secret');
+          expect(credentials.sessionToken).to.equal('session');
+        });
         it('prefers AWS credentials to AMAZON credentials', function() {
           process.env['AWS_ACCESS_KEY_ID'] = 'akid';
           process.env['AWS_SECRET_ACCESS_KEY'] = 'secret';