-
Notifications
You must be signed in to change notification settings - Fork 62
Use endpoint as default connection option (ADR-119) #1973
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
Changes from 6 commits
1dfd858
880628e
5b6c87e
a7ac263
0231be3
2989879
1f1a811
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,7 @@ import { gzip } from 'zlib'; | |
| import Table from 'cli-table'; | ||
|
|
||
| // The maximum size we allow for a minimal useful Realtime bundle (i.e. one that can subscribe to a channel) | ||
| const minimalUsefulRealtimeBundleSizeThresholdsKiB = { raw: 102, gzip: 31 }; | ||
| const minimalUsefulRealtimeBundleSizeThresholdsKiB = { raw: 103, gzip: 31 }; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Have to increase a little, bundle become 102.3kb |
||
|
|
||
| const baseClientNames = ['BaseRest', 'BaseRealtime']; | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -13,6 +13,7 @@ import { ModularPlugins } from '../client/modularplugins'; | |||||||||||||||||||||||||||||||||||||
| let agent = 'ably-js/' + version; | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| type CompleteDefaults = IDefaults & { | ||||||||||||||||||||||||||||||||||||||
| ENDPOINT: string; | ||||||||||||||||||||||||||||||||||||||
| ENVIRONMENT: string; | ||||||||||||||||||||||||||||||||||||||
| REST_HOST: string; | ||||||||||||||||||||||||||||||||||||||
| REALTIME_HOST: string; | ||||||||||||||||||||||||||||||||||||||
|
|
@@ -37,10 +38,10 @@ type CompleteDefaults = IDefaults & { | |||||||||||||||||||||||||||||||||||||
| version: string; | ||||||||||||||||||||||||||||||||||||||
| protocolVersion: number; | ||||||||||||||||||||||||||||||||||||||
| agent: string; | ||||||||||||||||||||||||||||||||||||||
| getHost(options: ClientOptions, host?: string | null, ws?: boolean): string; | ||||||||||||||||||||||||||||||||||||||
| getPort(options: ClientOptions, tls?: boolean): number | undefined; | ||||||||||||||||||||||||||||||||||||||
| getHttpScheme(options: ClientOptions): string; | ||||||||||||||||||||||||||||||||||||||
| environmentFallbackHosts(environment: string): string[]; | ||||||||||||||||||||||||||||||||||||||
| getPrimaryDomainFromEndpoint(endpoint: string): string; | ||||||||||||||||||||||||||||||||||||||
| getEndpointFallbackHosts(endpoint: string): string[]; | ||||||||||||||||||||||||||||||||||||||
| getFallbackHosts(options: NormalisedClientOptions): string[]; | ||||||||||||||||||||||||||||||||||||||
| getHosts(options: NormalisedClientOptions, ws?: boolean): string[]; | ||||||||||||||||||||||||||||||||||||||
| checkHost(host: string): void; | ||||||||||||||||||||||||||||||||||||||
|
|
@@ -57,15 +58,16 @@ type CompleteDefaults = IDefaults & { | |||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| const Defaults = { | ||||||||||||||||||||||||||||||||||||||
| ENDPOINT: 'main', | ||||||||||||||||||||||||||||||||||||||
| ENVIRONMENT: '', | ||||||||||||||||||||||||||||||||||||||
| REST_HOST: 'rest.ably.io', | ||||||||||||||||||||||||||||||||||||||
| REALTIME_HOST: 'realtime.ably.io', | ||||||||||||||||||||||||||||||||||||||
| FALLBACK_HOSTS: [ | ||||||||||||||||||||||||||||||||||||||
| 'A.ably-realtime.com', | ||||||||||||||||||||||||||||||||||||||
| 'B.ably-realtime.com', | ||||||||||||||||||||||||||||||||||||||
| 'C.ably-realtime.com', | ||||||||||||||||||||||||||||||||||||||
| 'D.ably-realtime.com', | ||||||||||||||||||||||||||||||||||||||
| 'E.ably-realtime.com', | ||||||||||||||||||||||||||||||||||||||
| 'main.a.fallback.ably-realtime.com', | ||||||||||||||||||||||||||||||||||||||
| 'main.b.fallback.ably-realtime.com', | ||||||||||||||||||||||||||||||||||||||
| 'main.c.fallback.ably-realtime.com', | ||||||||||||||||||||||||||||||||||||||
| 'main.d.fallback.ably-realtime.com', | ||||||||||||||||||||||||||||||||||||||
| 'main.e.fallback.ably-realtime.com', | ||||||||||||||||||||||||||||||||||||||
| ], | ||||||||||||||||||||||||||||||||||||||
| PORT: 80, | ||||||||||||||||||||||||||||||||||||||
| TLS_PORT: 443, | ||||||||||||||||||||||||||||||||||||||
|
|
@@ -91,10 +93,10 @@ const Defaults = { | |||||||||||||||||||||||||||||||||||||
| version, | ||||||||||||||||||||||||||||||||||||||
| protocolVersion: 3, | ||||||||||||||||||||||||||||||||||||||
| agent, | ||||||||||||||||||||||||||||||||||||||
| getHost, | ||||||||||||||||||||||||||||||||||||||
| getPort, | ||||||||||||||||||||||||||||||||||||||
| getHttpScheme, | ||||||||||||||||||||||||||||||||||||||
| environmentFallbackHosts, | ||||||||||||||||||||||||||||||||||||||
| getPrimaryDomainFromEndpoint, | ||||||||||||||||||||||||||||||||||||||
| getEndpointFallbackHosts, | ||||||||||||||||||||||||||||||||||||||
| getFallbackHosts, | ||||||||||||||||||||||||||||||||||||||
| getHosts, | ||||||||||||||||||||||||||||||||||||||
| checkHost, | ||||||||||||||||||||||||||||||||||||||
|
|
@@ -104,13 +106,6 @@ const Defaults = { | |||||||||||||||||||||||||||||||||||||
| defaultPostHeaders, | ||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| export function getHost(options: ClientOptions, host?: string | null, ws?: boolean): string { | ||||||||||||||||||||||||||||||||||||||
| if (ws) host = (host == options.restHost && options.realtimeHost) || host || options.realtimeHost; | ||||||||||||||||||||||||||||||||||||||
| else host = host || options.restHost; | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| return host as string; | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| export function getPort(options: ClientOptions, tls?: boolean): number | undefined { | ||||||||||||||||||||||||||||||||||||||
| return tls || options.tls ? options.tlsPort : options.port; | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
|
@@ -119,15 +114,51 @@ export function getHttpScheme(options: ClientOptions): string { | |||||||||||||||||||||||||||||||||||||
| return options.tls ? 'https://' : 'http://'; | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| // construct environment fallback hosts as per RSC15i | ||||||||||||||||||||||||||||||||||||||
| export function environmentFallbackHosts(environment: string): string[] { | ||||||||||||||||||||||||||||||||||||||
| return [ | ||||||||||||||||||||||||||||||||||||||
| environment + '-a-fallback.ably-realtime.com', | ||||||||||||||||||||||||||||||||||||||
| environment + '-b-fallback.ably-realtime.com', | ||||||||||||||||||||||||||||||||||||||
| environment + '-c-fallback.ably-realtime.com', | ||||||||||||||||||||||||||||||||||||||
| environment + '-d-fallback.ably-realtime.com', | ||||||||||||||||||||||||||||||||||||||
| environment + '-e-fallback.ably-realtime.com', | ||||||||||||||||||||||||||||||||||||||
| ]; | ||||||||||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||||||||||
| * REC1b2 | ||||||||||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||||||||||
| function isFqdnIpOrLocalhost(endpoint: string): boolean { | ||||||||||||||||||||||||||||||||||||||
| return endpoint.includes('.') || endpoint.includes('::') || endpoint === 'localhost'; | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
ttypic marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||||||||||
| * REC1b | ||||||||||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||||||||||
| export function getPrimaryDomainFromEndpoint(endpoint: string): string { | ||||||||||||||||||||||||||||||||||||||
| // REC1b2 (endpoint is a valid hostname) | ||||||||||||||||||||||||||||||||||||||
| if (isFqdnIpOrLocalhost(endpoint)) return endpoint; | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| // REC1b3 (endpoint in form "nonprod:[id]") | ||||||||||||||||||||||||||||||||||||||
| if (endpoint.startsWith('nonprod:')) { | ||||||||||||||||||||||||||||||||||||||
| const routingPolicyId = endpoint.replace('nonprod:', ''); | ||||||||||||||||||||||||||||||||||||||
| return `${routingPolicyId}.realtime.ably-nonprod.net`; | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| // REC1b4 (endpoint in form "[id]") | ||||||||||||||||||||||||||||||||||||||
| return `${endpoint}.realtime.ably.net`; | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||||||||||
| * REC2c | ||||||||||||||||||||||||||||||||||||||
| * | ||||||||||||||||||||||||||||||||||||||
| * @returns default callbacks based on endpoint client option | ||||||||||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||||||||||
| export function getEndpointFallbackHosts(endpoint: string): string[] { | ||||||||||||||||||||||||||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please can you annotate with the relevant spec points?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||||||||||||||||||||||||||||||||||||||
| // REC2c2 | ||||||||||||||||||||||||||||||||||||||
| if (isFqdnIpOrLocalhost(endpoint)) return []; | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| // REC2c3 | ||||||||||||||||||||||||||||||||||||||
| if (endpoint.startsWith('nonprod:')) { | ||||||||||||||||||||||||||||||||||||||
| const routingPolicyId = endpoint.replace('nonprod:', ''); | ||||||||||||||||||||||||||||||||||||||
| return endpointFallbacks(routingPolicyId, 'ably-realtime-nonprod.com'); | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| // REC2c1 | ||||||||||||||||||||||||||||||||||||||
| return endpointFallbacks(endpoint, 'ably-realtime.com'); | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| export function endpointFallbacks(routingPolicyId: string, domain: string): string[] { | ||||||||||||||||||||||||||||||||||||||
| return ['a', 'b', 'c', 'd', 'e'].map((id) => `${routingPolicyId}.${id}.fallback.${domain}`); | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| export function getFallbackHosts(options: NormalisedClientOptions): string[] { | ||||||||||||||||||||||||||||||||||||||
|
|
@@ -138,9 +169,8 @@ export function getFallbackHosts(options: NormalisedClientOptions): string[] { | |||||||||||||||||||||||||||||||||||||
| return fallbackHosts ? Utils.arrChooseN(fallbackHosts, httpMaxRetryCount) : []; | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| export function getHosts(options: NormalisedClientOptions, ws?: boolean): string[] { | ||||||||||||||||||||||||||||||||||||||
| const hosts = [options.restHost].concat(getFallbackHosts(options)); | ||||||||||||||||||||||||||||||||||||||
| return ws ? hosts.map((host) => getHost(options, host, true)) : hosts; | ||||||||||||||||||||||||||||||||||||||
| export function getHosts(options: NormalisedClientOptions): string[] { | ||||||||||||||||||||||||||||||||||||||
| return [options.primaryDomain].concat(getFallbackHosts(options)); | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| function checkHost(host: string): void { | ||||||||||||||||||||||||||||||||||||||
|
|
@@ -152,26 +182,6 @@ function checkHost(host: string): void { | |||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| function getRealtimeHost(options: ClientOptions, production: boolean, environment: string, logger: Logger): string { | ||||||||||||||||||||||||||||||||||||||
| if (options.realtimeHost) return options.realtimeHost; | ||||||||||||||||||||||||||||||||||||||
| /* prefer setting realtimeHost to restHost as a custom restHost typically indicates | ||||||||||||||||||||||||||||||||||||||
| * a development environment is being used that can't be inferred by the library */ | ||||||||||||||||||||||||||||||||||||||
| if (options.restHost) { | ||||||||||||||||||||||||||||||||||||||
| Logger.logAction( | ||||||||||||||||||||||||||||||||||||||
| logger, | ||||||||||||||||||||||||||||||||||||||
| Logger.LOG_MINOR, | ||||||||||||||||||||||||||||||||||||||
| 'Defaults.normaliseOptions', | ||||||||||||||||||||||||||||||||||||||
| 'restHost is set to "' + | ||||||||||||||||||||||||||||||||||||||
| options.restHost + | ||||||||||||||||||||||||||||||||||||||
| '" but realtimeHost is not set, so setting realtimeHost to "' + | ||||||||||||||||||||||||||||||||||||||
| options.restHost + | ||||||||||||||||||||||||||||||||||||||
| '" too. If this is not what you want, please set realtimeHost explicitly.', | ||||||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||||||
| return options.restHost; | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
| return production ? Defaults.REALTIME_HOST : environment + '-' + Defaults.REALTIME_HOST; | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| function getTimeouts(options: ClientOptions) { | ||||||||||||||||||||||||||||||||||||||
| /* Allow values passed in options to override default timeouts */ | ||||||||||||||||||||||||||||||||||||||
| const timeouts: Record<string, number> = {}; | ||||||||||||||||||||||||||||||||||||||
|
|
@@ -237,11 +247,35 @@ export function objectifyOptions( | |||||||||||||||||||||||||||||||||||||
| return optionsObj; | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| function checkIfClientOptionsAreValid(options: ClientOptions) { | ||||||||||||||||||||||||||||||||||||||
| // REC1b | ||||||||||||||||||||||||||||||||||||||
| if (options.endpoint && (options.environment || options.restHost || options.realtimeHost)) { | ||||||||||||||||||||||||||||||||||||||
| // RSC1b | ||||||||||||||||||||||||||||||||||||||
| throw new ErrorInfo( | ||||||||||||||||||||||||||||||||||||||
| 'The `endpoint` option cannot be used in conjunction with the `environment`, `restHost`, or `realtimeHost` options.', | ||||||||||||||||||||||||||||||||||||||
| 40106, | ||||||||||||||||||||||||||||||||||||||
| 400, | ||||||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| // REC1c | ||||||||||||||||||||||||||||||||||||||
| if (options.environment && (options.restHost || options.realtimeHost)) { | ||||||||||||||||||||||||||||||||||||||
| // RSC1b | ||||||||||||||||||||||||||||||||||||||
| throw new ErrorInfo( | ||||||||||||||||||||||||||||||||||||||
| 'The `environment` option cannot be used in conjunction with the `restHost`, or `realtimeHost` options.', | ||||||||||||||||||||||||||||||||||||||
| 40106, | ||||||||||||||||||||||||||||||||||||||
| 400, | ||||||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| export function normaliseOptions( | ||||||||||||||||||||||||||||||||||||||
| options: ClientOptions, | ||||||||||||||||||||||||||||||||||||||
| MsgPack: MsgPack | null, | ||||||||||||||||||||||||||||||||||||||
| logger: Logger | null, // should only be omitted by tests | ||||||||||||||||||||||||||||||||||||||
| ): NormalisedClientOptions { | ||||||||||||||||||||||||||||||||||||||
| checkIfClientOptionsAreValid(options); | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| const loggerToUse = logger ?? Logger.defaultLogger; | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| if (typeof options.recover === 'function' && options.closeOnUnload === true) { | ||||||||||||||||||||||||||||||||||||||
|
|
@@ -262,18 +296,19 @@ export function normaliseOptions( | |||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| if (!('queueMessages' in options)) options.queueMessages = true; | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| /* infer hosts and fallbacks based on the configured environment */ | ||||||||||||||||||||||||||||||||||||||
| const environment = (options.environment && String(options.environment).toLowerCase()) || Defaults.ENVIRONMENT; | ||||||||||||||||||||||||||||||||||||||
| const production = !environment || environment === 'production'; | ||||||||||||||||||||||||||||||||||||||
| /* infer hosts and fallbacks based on the specified endpoint */ | ||||||||||||||||||||||||||||||||||||||
| const endpoint = options.endpoint || Defaults.ENDPOINT; | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| if (!options.fallbackHosts && !options.restHost && !options.realtimeHost && !options.port && !options.tlsPort) { | ||||||||||||||||||||||||||||||||||||||
| options.fallbackHosts = production ? Defaults.FALLBACK_HOSTS : environmentFallbackHosts(environment); | ||||||||||||||||||||||||||||||||||||||
| options.fallbackHosts = getEndpointFallbackHosts(options.environment || endpoint); | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+299
to
304
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Incorrect fallback generation - should use endpoint, not environment. The fallback host generation is using - const endpoint = options.endpoint || Defaults.ENDPOINT;
+ const endpoint = options.endpoint || Defaults.ENDPOINT;
if (!options.fallbackHosts && !options.restHost && !options.realtimeHost && !options.port && !options.tlsPort) {
- options.fallbackHosts = getEndpointFallbackHosts(options.environment || endpoint);
+ options.fallbackHosts = getEndpointFallbackHosts(endpoint);
}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| const restHost = options.restHost || (production ? Defaults.REST_HOST : environment + '-' + Defaults.REST_HOST); | ||||||||||||||||||||||||||||||||||||||
| const realtimeHost = getRealtimeHost(options, production, environment, loggerToUse); | ||||||||||||||||||||||||||||||||||||||
| const primaryDomainFromEnvironment = options.environment && `${options.environment}.realtime.ably.net`; | ||||||||||||||||||||||||||||||||||||||
| const primaryDomainFromLegacyOptions = options.restHost || options.realtimeHost || primaryDomainFromEnvironment; | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| const primaryDomain = primaryDomainFromLegacyOptions || getPrimaryDomainFromEndpoint(endpoint); | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| (options.fallbackHosts || []).concat(restHost, realtimeHost).forEach(checkHost); | ||||||||||||||||||||||||||||||||||||||
| (options.fallbackHosts || []).concat(primaryDomain).forEach(checkHost); | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+306
to
312
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Primary domain resolution logic needs clarity and production handling. The logic for resolving the primary domain is complex and may not handle the 'production' environment case correctly. The environment-based logic should be simplified. - const primaryDomainFromEnvironment = options.environment && `${options.environment}.realtime.ably.net`;
+ const primaryDomainFromEnvironment = options.environment && options.environment !== 'production'
+ ? `${options.environment}.realtime.ably.net`
+ : undefined;
const primaryDomainFromLegacyOptions = options.restHost || options.realtimeHost || primaryDomainFromEnvironment;
const primaryDomain = primaryDomainFromLegacyOptions || getPrimaryDomainFromEndpoint(endpoint);📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||
| options.port = options.port || Defaults.PORT; | ||||||||||||||||||||||||||||||||||||||
| options.tlsPort = options.tlsPort || Defaults.TLS_PORT; | ||||||||||||||||||||||||||||||||||||||
|
|
@@ -318,8 +353,7 @@ export function normaliseOptions( | |||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| return { | ||||||||||||||||||||||||||||||||||||||
| ...options, | ||||||||||||||||||||||||||||||||||||||
| realtimeHost, | ||||||||||||||||||||||||||||||||||||||
| restHost, | ||||||||||||||||||||||||||||||||||||||
| primaryDomain: primaryDomain, | ||||||||||||||||||||||||||||||||||||||
| maxMessageSize: options.maxMessageSize || Defaults.maxMessageSize, | ||||||||||||||||||||||||||||||||||||||
| timeouts, | ||||||||||||||||||||||||||||||||||||||
| connectivityCheckParams, | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.