-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enhancement: error handling + exp flag #31
Conversation
@@ -54,7 +56,7 @@ export class Saturn { | |||
this._monitorPerformanceBuffer() | |||
} | |||
this.storage = this.opts.storage || memoryStorage() | |||
this.loadNodesPromise = this._loadNodes(this.opts) | |||
this.loadNodesPromise = this.opts.experimental ? this._loadNodes(this.opts) : null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DiegoRBaquero added this to only load nodes for the % we desire per a / b testing.
src/client.js
Outdated
@@ -81,7 +83,7 @@ export class Saturn { | |||
} | |||
} | |||
|
|||
const origins = options.origins | |||
const origins = options.origins || [options.cdnURL] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if options.origins
is an empty array it's still truthy so it won't fallback to cdnURL, is that ok here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not ok, thanks for flagging. I've added more logic to handle this better.
src/client.js
Outdated
@@ -81,7 +83,7 @@ export class Saturn { | |||
} | |||
} | |||
|
|||
const origins = options.origins | |||
const origins = options.origins || [options.cdnURL] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const origins = options.origins || [options.cdnURL] | |
const origins = options.origins ?? [options.cdnURL] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DiegoRBaquero updated this with your suggestion and eric's comment above
Changes: