nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: auth0/auth0.js
Pull request #922 (2019-04-11 17:36:12)

Modify telemetry inside the ULP
### Changes

Use a different telemetry name when inside the ULP


Patch:
diff --git a/src/helper/request-builder.js b/src/helper/request-builder.js
index f405b86..ff5fba9 100644
--- a/src/helper/request-builder.js
+++ b/src/helper/request-builder.js
@@ -67,6 +67,7 @@ function RequestBuilder(options) {
   this._telemetryInfo = options._telemetryInfo || null;
   this._timesToRetryFailedRequests = options._timesToRetryFailedRequests;
   this.headers = options.headers || {};
+  this._universalLoginPage = options.universalLoginPage;
 }
 
 RequestBuilder.prototype.setCommonConfiguration = function(ongoingRequest, options) {
@@ -97,7 +98,8 @@ RequestBuilder.prototype.setCommonConfiguration = function(ongoingRequest, optio
 };
 
 RequestBuilder.prototype.getTelemetryData = function() {
-  var clientInfo = this._telemetryInfo || { name: 'auth0.js', version: version.raw };
+  var telemetryName = this._universalLoginPage ? 'auth0.js-ulp' : 'auth0.js';
+  var clientInfo = this._telemetryInfo || { name: telemetryName, version: version.raw };
   var jsonClientInfo = JSON.stringify(clientInfo);
   return base64Url.encode(jsonClientInfo);
 };
diff --git a/src/web-auth/hosted-pages.js b/src/web-auth/hosted-pages.js
index e149088..ad128f7 100644
--- a/src/web-auth/hosted-pages.js
+++ b/src/web-auth/hosted-pages.js
@@ -12,6 +12,7 @@ import assert from '../helper/assert';
 function HostedPages(client, options) {
   this.baseOptions = options;
   this.client = client;
+  this.baseOptions.universalLoginPage = true;
   this.request = new RequestBuilder(this.baseOptions);
 
   this.warn = new Warn({


Test patch:
diff --git a/test/helper/request-builder.test.js b/test/helper/request-builder.test.js
index 20cfdb4..b5603bd 100644
--- a/test/helper/request-builder.test.js
+++ b/test/helper/request-builder.test.js
@@ -27,6 +27,14 @@ describe('helpers requestBuilder', function() {
         version: version.raw
       });
     });
+    it('should use ulp telemetry when `universalLoginPage` is true', function() {
+      var rb = new RequestBuilder({ _telemetryInfo: null, universalLoginPage: true });
+      var telemetry = rb.getTelemetryData();
+      expect(JSON.parse(base64url.decode(telemetry))).to.be.eql({
+        name: 'auth0.js-ulp',
+        version: version.raw
+      });
+    });
   });
   describe('with noHeaders:false', function() {
     before(function() {
diff --git a/test/web-auth/hosted-pages.test.js b/test/web-auth/hosted-pages.test.js
index ea24ee9..7d515cc 100644
--- a/test/web-auth/hosted-pages.test.js
+++ b/test/web-auth/hosted-pages.test.js
@@ -9,7 +9,7 @@ import WebAuth from '../../src/web-auth';
 import TransactionManager from '../../src/web-auth/transaction-manager';
 import RequestBuilder from '../../src/helper/request-builder';
 
-var telemetryInfo = new RequestBuilder({}).getTelemetryData();
+var telemetryInfo = new RequestBuilder({ universalLoginPage: true }).getTelemetryData();
 
 describe('auth0.WebAuth._universalLogin', function() {
   beforeEach(function() {
Repository: auth0/auth0.js
Pull request #933 (2019-05-07 19:54:50)

Fix telemetry customization
### Changes

Send default telemetry as `env` when telemetry is customized


Patch:
diff --git a/src/helper/request-builder.js b/src/helper/request-builder.js
index ff5fba9..e6805a7 100644
--- a/src/helper/request-builder.js
+++ b/src/helper/request-builder.js
@@ -99,7 +99,12 @@ RequestBuilder.prototype.setCommonConfiguration = function(ongoingRequest, optio
 
 RequestBuilder.prototype.getTelemetryData = function() {
   var telemetryName = this._universalLoginPage ? 'auth0.js-ulp' : 'auth0.js';
-  var clientInfo = this._telemetryInfo || { name: telemetryName, version: version.raw };
+  var clientInfo = { name: telemetryName, version: version.raw };
+  if (this._telemetryInfo) {
+    clientInfo = objectHelper.extend({}, this._telemetryInfo);
+    clientInfo.env = objectHelper.extend({}, this._telemetryInfo.env);
+    clientInfo.env[telemetryName] = version.raw;
+  }
   var jsonClientInfo = JSON.stringify(clientInfo);
   return base64Url.encode(jsonClientInfo);
 };


Test patch:
diff --git a/test/helper/request-builder.test.js b/test/helper/request-builder.test.js
index b5603bd..4d7be49 100644
--- a/test/helper/request-builder.test.js
+++ b/test/helper/request-builder.test.js
@@ -14,10 +14,19 @@ var telemetryInfo = new RequestBuilder({}).getTelemetryData();
 describe('helpers requestBuilder', function() {
   describe('getTelemetryData', function() {
     it('should encode telemetry', function() {
-      var rb = new RequestBuilder({ _telemetryInfo: { foo: 'bar' } });
+      var rb = new RequestBuilder({ _telemetryInfo: { foo: 'bar', env: { other: 'key' } } });
       var telemetry = rb.getTelemetryData();
-      expect(telemetry).to.be('eyJmb28iOiJiYXIifQ==');
-      expect(JSON.parse(base64url.decode(telemetry))).to.be.eql({ foo: 'bar' });
+
+      expect(JSON.parse(base64url.decode(telemetry))).to.be.eql({
+        foo: 'bar',
+        env: {
+          other: 'key',
+          'auth0.js': version.raw
+        }
+      });
+      expect(telemetry).to.be(
+        'eyJmb28iOiJiYXIiLCJlbnYiOnsib3RoZXIiOiJrZXkiLCJhdXRoMC5qcyI6IjkuMTAuMiJ9fQ=='
+      );
     });
     it('should use default telemetry', function() {
       var rb = new RequestBuilder({ _telemetryInfo: null });
Repository: auth0/auth0.js
Pull request #938 (2019-05-22 02:05:13)

Fix appState warning
fix https://github.com/auth0/auth0.js/issues/919

### Changes

Removes the `appState` param from the url sent to the /authorize endpoint


Patch:
diff --git a/src/authentication/index.js b/src/authentication/index.js
index 733ed7e..2e935cd 100644
--- a/src/authentication/index.js
+++ b/src/authentication/index.js
@@ -152,7 +152,8 @@ Authentication.prototype.buildAuthorizeUrl = function(options) {
     'popupOptions',
     'domain',
     'tenant',
-    'timeout'
+    'timeout',
+    'appState'
   ]);
   params = objectHelper.toSnakeCase(params, ['auth0Client']);
   params = parametersWhitelist.oauthAuthorizeParams(this.warn, params);


Test patch:
diff --git a/test/authentication/authentication.test.js b/test/authentication/authentication.test.js
index 8da12dc..8eb0d00 100644
--- a/test/authentication/authentication.test.js
+++ b/test/authentication/authentication.test.js
@@ -76,7 +76,9 @@ describe('auth0.authentication', function() {
       });
     });
 
-    ['username', 'popupOptions', 'domain', 'tenant', 'timeout'].forEach(function(param) {
+    ['username', 'popupOptions', 'domain', 'tenant', 'timeout', 'appState'].forEach(function(
+      param
+    ) {
       it('should remove parameter: ' + param, function() {
         var options = {};
         options[param] = 'foobar';
Repository: auth0/auth0.js
Pull request #943 (2019-05-24 19:09:45)

Fix checksession success response casing
fix https://github.com/auth0/auth0.js/issues/942

### Changes

When fixing the error format, we messed up the success response casing as well. I'm adding a test case to make sure this doesn't happen in the future.


Patch:
diff --git a/src/web-auth/index.js b/src/web-auth/index.js
index 62a9cad..6ae0c1d 100644
--- a/src/web-auth/index.js
+++ b/src/web-auth/index.js
@@ -481,7 +481,10 @@ WebAuth.prototype.checkSession = function(options, cb) {
   assert.check(cb, { type: 'function', message: 'cb parameter is not valid' });
 
   params = objectHelper.blacklist(params, ['usePostMessage', 'tenant', 'postMessageDataType']);
-  this.webMessageHandler.run(params, responseHandler(cb, { forceLegacyError: true }));
+  this.webMessageHandler.run(
+    params,
+    responseHandler(cb, { forceLegacyError: true, ignoreCasing: true })
+  );
 };
 
 /**


Test patch:
diff --git a/test/web-auth/web-auth.test.js b/test/web-auth/web-auth.test.js
index 7290ec6..79e6466 100644
--- a/test/web-auth/web-auth.test.js
+++ b/test/web-auth/web-auth.test.js
@@ -2577,6 +2577,28 @@ describe('auth0.WebAuth', function() {
         done();
       });
     });
+    it('callback handles success response without changing idTokenPayload casing', function(done) {
+      var response = {
+        access_token: 'foobar',
+        idTokenPayload: {
+          email_verified: false
+        }
+      };
+      stub(WebAuth.prototype, 'validateAuthenticationResponse', function(options, parsedHash, cb) {
+        cb(null, {
+          accessToken: response.access_token,
+          idTokenPayload: response.idTokenPayload
+        });
+      });
+      stub(IframeHandler.prototype, 'init', function() {
+        this.callback({ event: { data: { response: response } } });
+      });
+      this.auth0.checkSession({}, function(err, data) {
+        expect(err).to.be(null);
+        expect(data).to.be.eql({ accessToken: 'foobar', idTokenPayload: response.idTokenPayload });
+        done();
+      });
+    });
   });
 
   context('validateToken', function() {
Repository: auth0/auth0.js
Pull request #1117 (2020-07-01 18:35:49)

[CAUTH-423]  Add login state if available to the sign-up request
### Changes

Include the login `state` as a parameter in the sign-up call if available. This affects only in the classic Hosted Login Page and is optional for most of the cases. 

### References

https://auth0team.atlassian.net/browse/CAUTH-423

### Testing

- [x] This change adds unit test coverage
- [ ] This change adds integration test coverage

### Checklist

- [x] I have read the [Auth0 general contribution guidelines](https://github.com/auth0/open-source-template/blob/master/GENERAL-CONTRIBUTING.md)
- [x] I have read the [Auth0 Code of Conduct](https://github.com/auth0/open-source-template/blob/master/CODE-OF-CONDUCT.md)
- [x] All tests and linters described in the [Develop section](https://github.com/auth0/auth0.js#develop) run without errors



Patch:
diff --git a/src/authentication/db-connection.js b/src/authentication/db-connection.js
index d7f4b06..60b22a7 100644
--- a/src/authentication/db-connection.js
+++ b/src/authentication/db-connection.js
@@ -48,7 +48,7 @@ DBConnection.prototype.signup = function(options, cb) {
 
   url = urljoin(this.baseOptions.rootUrl, 'dbconnections', 'signup');
 
-  body = objectHelper.merge(this.baseOptions, ['clientID']).with(options);
+  body = objectHelper.merge(this.baseOptions, ['clientID', 'state']).with(options);
 
   metadata = body.user_metadata || body.userMetadata;
 


Test patch:
diff --git a/test/authentication/db-connection.test.js b/test/authentication/db-connection.test.js
index f4e07ea..a34c32a 100644
--- a/test/authentication/db-connection.test.js
+++ b/test/authentication/db-connection.test.js
@@ -15,7 +15,8 @@ describe('auth0.authentication', function() {
         domain: 'me.auth0.com',
         clientID: '...',
         redirectUri: 'http://page.com/callback',
-        responseType: 'code'
+        responseType: 'code',
+        state: 'state-xyz'
       });
     });
 
@@ -80,6 +81,7 @@ describe('auth0.authentication', function() {
           return new RequestMock({
             body: {
               client_id: '...',
+              state: 'state-xyz',
               email: 'the email',
               password: 'the password',
               connection: 'the_connection',
@@ -129,6 +131,7 @@ describe('auth0.authentication', function() {
           return new RequestMock({
             body: {
               client_id: '...',
+              state: 'state-xyz',
               email: 'the email',
               password: 'the password',
               connection: 'the_connection',
Repository: garmeeh/next-seo
Pull request #1193 (2023-04-01 18:24:35)

Revert "Fix default robots overriding"
Reverts garmeeh/next-seo#728


Patch:
diff --git a/src/meta/buildTags.tsx b/src/meta/buildTags.tsx
index 0c7065a..0560ea1 100644
--- a/src/meta/buildTags.tsx
+++ b/src/meta/buildTags.tsx
@@ -119,13 +119,13 @@ const buildTags = (config: BuildTagsParams) => {
   }
 
   const noindex =
-    config.noindex != null
-      ? config.noindex
-      : config.dangerouslySetAllPagesToNoIndex || defaults.noindex;
+    config.noindex ||
+    defaults.noindex ||
+    config.dangerouslySetAllPagesToNoIndex;
   const nofollow =
-    config.nofollow != null
-      ? config.nofollow
-      : config.dangerouslySetAllPagesToNoFollow || defaults.nofollow;
+    config.nofollow ||
+    defaults.nofollow ||
+    config.dangerouslySetAllPagesToNoFollow;
 
   let robotsParams = '';
   if (config.robotsProps) {
@@ -152,6 +152,13 @@ const buildTags = (config: BuildTagsParams) => {
   }
 
   if (noindex || nofollow) {
+    if (config.dangerouslySetAllPagesToNoIndex) {
+      defaults.noindex = true;
+    }
+    if (config.dangerouslySetAllPagesToNoFollow) {
+      defaults.nofollow = true;
+    }
+
     tagsToRender.push(
       <meta
         key="robots"


Test patch:
diff --git a/src/meta/__tests__/buildTags.spec.tsx b/src/meta/__tests__/buildTags.spec.tsx
index 3ecca75..4922896 100644
--- a/src/meta/__tests__/buildTags.spec.tsx
+++ b/src/meta/__tests__/buildTags.spec.tsx
@@ -923,7 +923,7 @@ it('correctly sets nofollow default', () => {
     'meta[content="index,follow"]',
   );
   const noindexnofollow = container.querySelectorAll(
-    'meta[content="index,nofollow"]',
+    'meta[content="noindex,nofollow"]',
   );
 
   expect(Array.from(indexfollow).length).toBe(0);
@@ -945,8 +945,8 @@ it('correctly read noindex & nofollow false', () => {
     'meta[content="noindex,nofollow"]',
   );
 
-  expect(Array.from(indexfollow).length).toBe(1);
-  expect(Array.from(noindexnofollow).length).toBe(0);
+  expect(Array.from(indexfollow).length).toBe(0);
+  expect(Array.from(noindexnofollow).length).toBe(1);
 });
 
 it('correctly read all robots props', () => {
Repository: prettier/prettier-atom
Pull request #247 (2017-08-12 13:42:50)

feat(formatOnSave): Added 'eslint-plugin-prettier' to list of packages to look for


Patch:
diff --git a/dist/formatOnSave/isPrettierInPackageJson.js b/dist/formatOnSave/isPrettierInPackageJson.js
index 90d9dce..61cec05 100644
--- a/dist/formatOnSave/isPrettierInPackageJson.js
+++ b/dist/formatOnSave/isPrettierInPackageJson.js
@@ -25,6 +25,6 @@ var readContentsOfNearestPackageJson = _.flow(getCurrentDir, _.set('cwd', _, {})
 
 var isPrettierInPackageJson = _.flow(readContentsOfNearestPackageJson, hasPackage('prettier'));
 
-var isPrettierEslintInPackageJson = _.flow(readContentsOfNearestPackageJson, _.overSome([hasPackage('prettier-eslint'), hasPackage('prettier-eslint-cli')]));
+var isPrettierEslintInPackageJson = _.flow(readContentsOfNearestPackageJson, _.overSome([hasPackage('prettier-eslint'), hasPackage('prettier-eslint-cli'), hasPackage('eslint-plugin-prettier')]));
 
 module.exports = _.cond([[shouldUseEslint, isPrettierEslintInPackageJson], [_.stubTrue, isPrettierInPackageJson]]);
\ No newline at end of file
diff --git a/src/formatOnSave/isPrettierInPackageJson.js b/src/formatOnSave/isPrettierInPackageJson.js
index e26c998..cdfe407 100644
--- a/src/formatOnSave/isPrettierInPackageJson.js
+++ b/src/formatOnSave/isPrettierInPackageJson.js
@@ -27,7 +27,11 @@ const isPrettierInPackageJson: (editor: TextEditor) => boolean = _.flow(
 
 const isPrettierEslintInPackageJson: (editor: TextEditor) => boolean = _.flow(
   readContentsOfNearestPackageJson,
-  _.overSome([hasPackage('prettier-eslint'), hasPackage('prettier-eslint-cli')]),
+  _.overSome([
+    hasPackage('prettier-eslint'),
+    hasPackage('prettier-eslint-cli'),
+    hasPackage('eslint-plugin-prettier'),
+  ]),
 );
 
 module.exports = _.cond([


Test patch:
diff --git a/src/formatOnSave/isPrettierInPackageJson.test.js b/src/formatOnSave/isPrettierInPackageJson.test.js
index fcf8a4e..6d12070 100644
--- a/src/formatOnSave/isPrettierInPackageJson.test.js
+++ b/src/formatOnSave/isPrettierInPackageJson.test.js
@@ -90,7 +90,27 @@ describe('when shouldUseEslint is true', () => {
     expect(actual).toBe(true);
   });
 
-  it('is false if neither prettier-eslint nor prettier-eslint-cli are dependencies', () => {
+  it('is true if eslint-plugin-prettier is a dependency', () => {
+    readPkgUp.sync.mockImplementation(() => ({
+      pkg: { dependencies: { 'eslint-plugin-prettier': '^0.0.1' } },
+    }));
+
+    const actual = isPrettierInPackageJson();
+
+    expect(actual).toBe(true);
+  });
+
+  it('is true if eslint-plugin-prettier is a dev dependency', () => {
+    readPkgUp.sync.mockImplementation(() => ({
+      pkg: { devDependencies: { 'eslint-plugin-prettier': '^0.0.1' } },
+    }));
+
+    const actual = isPrettierInPackageJson();
+
+    expect(actual).toBe(true);
+  });
+
+  it('is false if missing prettier-eslint, prettier-eslint-cli, or eslint-plugin-prettier packges', () => {
     const actual = isPrettierInPackageJson();
 
     expect(actual).toBe(false);