Skip to content

Commit 6658cac

Browse files
committed
Revert "feat(rc): Web support for ABT & Rollouts (#9293)"
This reverts commit 6abe529.
1 parent 6abe529 commit 6658cac

File tree

18 files changed

+20
-479
lines changed

18 files changed

+20
-479
lines changed

.changeset/wild-snakes-bathe.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

common/api-review/remote-config.api.md

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ export function fetchConfig(remoteConfig: RemoteConfig): Promise<void>;
4141
export interface FetchResponse {
4242
config?: FirebaseRemoteConfigObject;
4343
eTag?: string;
44-
experiments?: FirebaseExperimentDescription[];
4544
status: number;
4645
templateVersion?: number;
4746
}
@@ -52,22 +51,6 @@ export type FetchStatus = 'no-fetch-yet' | 'success' | 'failure' | 'throttle';
5251
// @public
5352
export type FetchType = 'BASE' | 'REALTIME';
5453

55-
// @public
56-
export interface FirebaseExperimentDescription {
57-
// (undocumented)
58-
affectedParameterKeys?: string[];
59-
// (undocumented)
60-
experimentId: string;
61-
// (undocumented)
62-
experimentStartTime: string;
63-
// (undocumented)
64-
timeToLiveMillis: string;
65-
// (undocumented)
66-
triggerTimeoutMillis: string;
67-
// (undocumented)
68-
variantId: string;
69-
}
70-
7154
// @public
7255
export interface FirebaseRemoteConfigObject {
7356
// (undocumented)

docs-devsite/_toc.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -661,8 +661,6 @@ toc:
661661
path: /docs/reference/js/remote-config.customsignals.md
662662
- title: FetchResponse
663663
path: /docs/reference/js/remote-config.fetchresponse.md
664-
- title: FirebaseExperimentDescription
665-
path: /docs/reference/js/remote-config.firebaseexperimentdescription.md
666664
- title: FirebaseRemoteConfigObject
667665
path: /docs/reference/js/remote-config.firebaseremoteconfigobject.md
668666
- title: RemoteConfig

docs-devsite/remote-config.fetchresponse.md

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ export interface FetchResponse
2626
| --- | --- | --- |
2727
| [config](./remote-config.fetchresponse.md#fetchresponseconfig) | [FirebaseRemoteConfigObject](./remote-config.firebaseremoteconfigobject.md#firebaseremoteconfigobject_interface) | Defines the map of parameters returned as "entries" in the fetch response body.<p>Only defined for 200 responses. |
2828
| [eTag](./remote-config.fetchresponse.md#fetchresponseetag) | string | Defines the ETag response header value.<p>Only defined for 200 and 304 responses. |
29-
| [experiments](./remote-config.fetchresponse.md#fetchresponseexperiments) | [FirebaseExperimentDescription](./remote-config.firebaseexperimentdescription.md#firebaseexperimentdescription_interface)<!-- -->\[\] | Metadata for A/B testing and Remote Config Rollout experiments. |
3029
| [status](./remote-config.fetchresponse.md#fetchresponsestatus) | number | The HTTP status, which is useful for differentiating success responses with data from those without.<p>The Remote Config client is modeled after the native <code>Fetch</code> interface, so HTTP status is first-class.<p>Disambiguation: the fetch response returns a legacy "state" value that is redundant with the HTTP status code. The former is normalized into the latter. |
3130
| [templateVersion](./remote-config.fetchresponse.md#fetchresponsetemplateversion) | number | The version number of the config template fetched from the server. |
3231

@@ -54,18 +53,6 @@ Defines the ETag response header value.
5453
eTag?: string;
5554
```
5655

57-
## FetchResponse.experiments
58-
59-
Metadata for A/B testing and Remote Config Rollout experiments.
60-
61-
Only defined for 200 responses.
62-
63-
<b>Signature:</b>
64-
65-
```typescript
66-
experiments?: FirebaseExperimentDescription[];
67-
```
68-
6956
## FetchResponse.status
7057

7158
The HTTP status, which is useful for differentiating success responses with data from those without.

docs-devsite/remote-config.firebaseexperimentdescription.md

Lines changed: 0 additions & 78 deletions
This file was deleted.

docs-devsite/remote-config.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ The Firebase Remote Config Web SDK. This SDK does not work in a Node.js environm
4242
| [ConfigUpdateObserver](./remote-config.configupdateobserver.md#configupdateobserver_interface) | Observer interface for receiving real-time Remote Config update notifications.<!-- -->NOTE: Although an <code>complete</code> callback can be provided, it will never be called because the ConfigUpdate stream is never-ending. |
4343
| [CustomSignals](./remote-config.customsignals.md#customsignals_interface) | Defines the type for representing custom signals and their values.<p>The values in CustomSignals must be one of the following types:<ul> <li><code>string</code> <li><code>number</code> <li><code>null</code> </ul> |
4444
| [FetchResponse](./remote-config.fetchresponse.md#fetchresponse_interface) | Defines a successful response (200 or 304).<p>Modeled after the native <code>Response</code> interface, but simplified for Remote Config's use case. |
45-
| [FirebaseExperimentDescription](./remote-config.firebaseexperimentdescription.md#firebaseexperimentdescription_interface) | Defines experiment and variant attached to a config parameter. |
4645
| [FirebaseRemoteConfigObject](./remote-config.firebaseremoteconfigobject.md#firebaseremoteconfigobject_interface) | Defines a self-descriptive reference for config key-value pairs. |
4746
| [RemoteConfig](./remote-config.remoteconfig.md#remoteconfig_interface) | The Firebase Remote Config service interface. |
4847
| [RemoteConfigOptions](./remote-config.remoteconfigoptions.md#remoteconfigoptions_interface) | Options for Remote Config initialization. |

packages/remote-config/src/abt/experiment.ts

Lines changed: 0 additions & 102 deletions
This file was deleted.

packages/remote-config/src/api.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ import { ERROR_FACTORY, ErrorCode, hasErrorCode } from './errors';
3636
import { RemoteConfig as RemoteConfigImpl } from './remote_config';
3737
import { Value as ValueImpl } from './value';
3838
import { LogLevel as FirebaseLogLevel } from '@firebase/logger';
39-
import { Experiment } from './abt/experiment';
4039

4140
/**
4241
*
@@ -111,19 +110,12 @@ export async function activate(remoteConfig: RemoteConfig): Promise<boolean> {
111110
// config.
112111
return false;
113112
}
114-
const experiment = new Experiment(rc);
115-
const updateActiveExperiments = lastSuccessfulFetchResponse.experiments
116-
? experiment.updateActiveExperiments(
117-
lastSuccessfulFetchResponse.experiments
118-
)
119-
: Promise.resolve();
120113
await Promise.all([
121114
rc._storageCache.setActiveConfig(lastSuccessfulFetchResponse.config),
122115
rc._storage.setActiveConfigEtag(lastSuccessfulFetchResponse.eTag),
123116
rc._storage.setActiveConfigTemplateVersion(
124117
lastSuccessfulFetchResponse.templateVersion
125-
),
126-
updateActiveExperiments
118+
)
127119
]);
128120
return true;
129121
}

packages/remote-config/src/client/rest_client.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
import {
1919
CustomSignals,
2020
FetchResponse,
21-
FirebaseRemoteConfigObject,
22-
FirebaseExperimentDescription
21+
FirebaseRemoteConfigObject
2322
} from '../public_types';
2423
import {
2524
RemoteConfigFetchClient,
@@ -144,7 +143,6 @@ export class RestClient implements RemoteConfigFetchClient {
144143
let config: FirebaseRemoteConfigObject | undefined;
145144
let state: string | undefined;
146145
let templateVersion: number | undefined;
147-
let experiments: FirebaseExperimentDescription[] | undefined;
148146

149147
// JSON parsing throws SyntaxError if the response body isn't a JSON string.
150148
// Requesting application/json and checking for a 200 ensures there's JSON data.
@@ -160,7 +158,6 @@ export class RestClient implements RemoteConfigFetchClient {
160158
config = responseBody['entries'];
161159
state = responseBody['state'];
162160
templateVersion = responseBody['templateVersion'];
163-
experiments = responseBody['experimentDescriptions'];
164161
}
165162

166163
// Normalizes based on legacy state.
@@ -171,7 +168,6 @@ export class RestClient implements RemoteConfigFetchClient {
171168
} else if (state === 'NO_TEMPLATE' || state === 'EMPTY_CONFIG') {
172169
// These cases can be fixed remotely, so normalize to safe value.
173170
config = {};
174-
experiments = [];
175171
}
176172

177173
// Normalize to exception-based control flow for non-success cases.
@@ -184,6 +180,6 @@ export class RestClient implements RemoteConfigFetchClient {
184180
});
185181
}
186182

187-
return { status, eTag: responseEtag, config, templateVersion, experiments };
183+
return { status, eTag: responseEtag, config, templateVersion };
188184
}
189185
}

packages/remote-config/src/errors.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ export const enum ErrorCode {
3737
CONFIG_UPDATE_STREAM_ERROR = 'stream-error',
3838
CONFIG_UPDATE_UNAVAILABLE = 'realtime-unavailable',
3939
CONFIG_UPDATE_MESSAGE_INVALID = 'update-message-invalid',
40-
CONFIG_UPDATE_NOT_FETCHED = 'update-not-fetched',
41-
ANALYTICS_UNAVAILABLE = 'analytics-unavailable'
40+
CONFIG_UPDATE_NOT_FETCHED = 'update-not-fetched'
4241
}
4342

4443
const ERROR_DESCRIPTION_MAP: { readonly [key in ErrorCode]: string } = {
@@ -85,9 +84,7 @@ const ERROR_DESCRIPTION_MAP: { readonly [key in ErrorCode]: string } = {
8584
[ErrorCode.CONFIG_UPDATE_MESSAGE_INVALID]:
8685
'The stream invalidation message was unparsable: {$originalErrorMessage}',
8786
[ErrorCode.CONFIG_UPDATE_NOT_FETCHED]:
88-
'Unable to fetch the latest config: {$originalErrorMessage}',
89-
[ErrorCode.ANALYTICS_UNAVAILABLE]:
90-
'Connection to Firebase Analytics failed: {$originalErrorMessage}'
87+
'Unable to fetch the latest config: {$originalErrorMessage}'
9188
};
9289

9390
// Note this is effectively a type system binding a code to params. This approach overlaps with the
@@ -111,7 +108,6 @@ interface ErrorParams {
111108
[ErrorCode.CONFIG_UPDATE_UNAVAILABLE]: { originalErrorMessage: string };
112109
[ErrorCode.CONFIG_UPDATE_MESSAGE_INVALID]: { originalErrorMessage: string };
113110
[ErrorCode.CONFIG_UPDATE_NOT_FETCHED]: { originalErrorMessage: string };
114-
[ErrorCode.ANALYTICS_UNAVAILABLE]: { originalErrorMessage: string };
115111
}
116112

117113
export const ERROR_FACTORY = new ErrorFactory<ErrorCode, ErrorParams>(

0 commit comments

Comments
 (0)