Skip to content

Commit

Permalink
Unmap configUrl from direct silo
Browse files Browse the repository at this point in the history
  • Loading branch information
rmi22186 committed Nov 6, 2023
1 parent 507c5d1 commit 5a3d1b3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
3 changes: 3 additions & 0 deletions src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,9 @@ export function processEndpoints(
if (config.hasOwnProperty(endpointKey)) {
endpoints[endpointKey] = config[endpointKey];
} else {
if (endpointKey === 'configUrl') {
continue;
}
var urlparts = endpoints[endpointKey].split('.');

endpoints[endpointKey] = [
Expand Down
12 changes: 6 additions & 6 deletions test/src/tests-core-sdk.js
Original file line number Diff line number Diff line change
Expand Up @@ -1174,7 +1174,7 @@ describe('core SDK', function() {

mParticle.init(apiKey, window.mParticle.config);
mParticle.getInstance()._Store.SDKConfig.aliasUrl.should.equal(URLs[silo].aliasUrl);
mParticle.getInstance()._Store.SDKConfig.configUrl.should.equal(URLs[silo].configUrl);
mParticle.getInstance()._Store.SDKConfig.configUrl.should.equal(Constants.DefaultUrls.configUrl);
mParticle.getInstance()._Store.SDKConfig.identityUrl.should.equal(URLs[silo].identityUrl);
mParticle.getInstance()._Store.SDKConfig.v1SecureServiceUrl.should.equal(URLs[silo].v1SecureServiceUrl);
mParticle.getInstance()._Store.SDKConfig.v2SecureServiceUrl.should.equal(URLs[silo].v2SecureServiceUrl);
Expand All @@ -1192,7 +1192,7 @@ describe('core SDK', function() {

mParticle.init(apiKey, window.mParticle.config);
mParticle.getInstance()._Store.SDKConfig.aliasUrl.should.equal(URLs[silo].aliasUrl);
mParticle.getInstance()._Store.SDKConfig.configUrl.should.equal(URLs[silo].configUrl);
mParticle.getInstance()._Store.SDKConfig.configUrl.should.equal(Constants.DefaultUrls.configUrl);
mParticle.getInstance()._Store.SDKConfig.identityUrl.should.equal(URLs[silo].identityUrl);
mParticle.getInstance()._Store.SDKConfig.v1SecureServiceUrl.should.equal(URLs[silo].v1SecureServiceUrl);
mParticle.getInstance()._Store.SDKConfig.v2SecureServiceUrl.should.equal(URLs[silo].v2SecureServiceUrl);
Expand All @@ -1210,7 +1210,7 @@ describe('core SDK', function() {

mParticle.init(apiKey, window.mParticle.config);
mParticle.getInstance()._Store.SDKConfig.aliasUrl.should.equal(URLs[silo].aliasUrl);
mParticle.getInstance()._Store.SDKConfig.configUrl.should.equal(URLs[silo].configUrl);
mParticle.getInstance()._Store.SDKConfig.configUrl.should.equal(Constants.DefaultUrls.configUrl);
mParticle.getInstance()._Store.SDKConfig.identityUrl.should.equal(URLs[silo].identityUrl);
mParticle.getInstance()._Store.SDKConfig.v1SecureServiceUrl.should.equal(URLs[silo].v1SecureServiceUrl);
mParticle.getInstance()._Store.SDKConfig.v2SecureServiceUrl.should.equal(URLs[silo].v2SecureServiceUrl);
Expand All @@ -1228,7 +1228,7 @@ describe('core SDK', function() {

mParticle.init(apiKey, window.mParticle.config);
mParticle.getInstance()._Store.SDKConfig.aliasUrl.should.equal(URLs[silo].aliasUrl);
mParticle.getInstance()._Store.SDKConfig.configUrl.should.equal(URLs[silo].configUrl);
mParticle.getInstance()._Store.SDKConfig.configUrl.should.equal(Constants.DefaultUrls.configUrl);
mParticle.getInstance()._Store.SDKConfig.identityUrl.should.equal(URLs[silo].identityUrl);
mParticle.getInstance()._Store.SDKConfig.v1SecureServiceUrl.should.equal(URLs[silo].v1SecureServiceUrl);
mParticle.getInstance()._Store.SDKConfig.v2SecureServiceUrl.should.equal(URLs[silo].v2SecureServiceUrl);
Expand All @@ -1246,7 +1246,7 @@ describe('core SDK', function() {

mParticle.init(apiKey, window.mParticle.config);
mParticle.getInstance()._Store.SDKConfig.aliasUrl.should.equal(URLs[silo].aliasUrl);
mParticle.getInstance()._Store.SDKConfig.configUrl.should.equal(URLs[silo].configUrl);
mParticle.getInstance()._Store.SDKConfig.configUrl.should.equal(Constants.DefaultUrls.configUrl);
mParticle.getInstance()._Store.SDKConfig.identityUrl.should.equal(URLs[silo].identityUrl);
mParticle.getInstance()._Store.SDKConfig.v1SecureServiceUrl.should.equal(URLs[silo].v1SecureServiceUrl);
mParticle.getInstance()._Store.SDKConfig.v2SecureServiceUrl.should.equal(URLs[silo].v2SecureServiceUrl);
Expand All @@ -1264,7 +1264,7 @@ describe('core SDK', function() {

mParticle.init(apiKey, window.mParticle.config);
mParticle.getInstance()._Store.SDKConfig.aliasUrl.should.equal(URLs[silo].aliasUrl);
mParticle.getInstance()._Store.SDKConfig.configUrl.should.equal(URLs[silo].configUrl);
mParticle.getInstance()._Store.SDKConfig.configUrl.should.equal(Constants.DefaultUrls.configUrl);
mParticle.getInstance()._Store.SDKConfig.identityUrl.should.equal(URLs[silo].identityUrl);
mParticle.getInstance()._Store.SDKConfig.v1SecureServiceUrl.should.equal(URLs[silo].v1SecureServiceUrl);
mParticle.getInstance()._Store.SDKConfig.v2SecureServiceUrl.should.equal(URLs[silo].v2SecureServiceUrl);
Expand Down
2 changes: 1 addition & 1 deletion test/src/tests-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,8 @@ describe('Store', () => {
);

const expectedResult = {
configUrl: Constants.DefaultUrls.configUrl,
aliasUrl: "jssdks.us1.mparticle.com/v1/identity/",
configUrl: "jssdkcdns.us1.mparticle.com/JS/v2/",
identityUrl: "identity.us1.mparticle.com/v1/",
v1SecureServiceUrl: "jssdks.us1.mparticle.com/v1/JS/",
v2SecureServiceUrl: "jssdks.us1.mparticle.com/v2/JS/",
Expand Down

0 comments on commit 5a3d1b3

Please sign in to comment.