chore: disappear feature switch based on env variable for QA

pull/2971/head
Audric Ackermann 1 year ago
parent b731774ac7
commit 8872ccf7fe

@ -1,3 +1,4 @@
import { isEmpty } from 'lodash';
import { GetNetworkTime } from '../session/apis/snode_api/getNetworkTime';
import { FEATURE_RELEASE_TIMESTAMPS } from '../session/constants';
import { ConfigurationSync } from '../session/utils/job_runners/jobs/ConfigurationSyncJob';
@ -100,7 +101,10 @@ async function checkIsUserConfigFeatureReleased() {
}
async function checkIsDisappearMessageV2FeatureReleased() {
return checkIsFeatureReleased('disappearing_messages');
return (
checkIsFeatureReleased('disappearing_messages') ||
!isEmpty(process.env.SESSION_FORCE_DISAPPEAR_V2_ENABLED) // FIXME to remove after QA
);
}
function isUserConfigFeatureReleasedCached(): boolean {
@ -109,7 +113,10 @@ function isUserConfigFeatureReleasedCached(): boolean {
// NOTE Make sure to call checkIsDisappearMessageV2FeatureReleased at least once and then use this. It's mostly used in components that are rendered where we don't want to do async calls
function isDisappearMessageV2FeatureReleasedCached(): boolean {
return !!isDisappearingMessageFeatureReleased;
return (
!!isDisappearingMessageFeatureReleased ||
!isEmpty(process.env.SESSION_FORCE_DISAPPEAR_V2_ENABLED) // FIXME to remove after QA
);
}
export const ReleasedFeatures = {
@ -118,12 +125,3 @@ export const ReleasedFeatures = {
isUserConfigFeatureReleasedCached,
isDisappearMessageV2FeatureReleasedCached,
};
// TODO DO NOT MERGE Remove after QA
async function setIsFeatureReleased(featureName: FeatureNameTracked, value: boolean) {
await Storage.put(featureStorageItemId(featureName), value);
setIsFeatureReleasedCached(featureName, value);
window.log.debug(`WIP: [releaseFeature]: ${featureName} ${value}`);
}
window.setIsFeatureReleased = setIsFeatureReleased;

3
ts/window.d.ts vendored

@ -5,7 +5,6 @@ import { LocalizerType } from './types/Util';
import { ConversationCollection } from './models/conversation';
import { PrimaryColorStateType, ThemeStateType } from './themes/constants/colors';
import { FeatureNameTracked } from './util/releaseFeature';
export interface LibTextsecure {
messaging: boolean;
@ -105,8 +104,6 @@ declare global {
setAutoUpdateEnabled: (enabled: boolean) => void;
setZoomFactor: (newZoom: number) => void;
updateZoomFactor: () => void;
// TODO DO NOT MERGE Remove after QA
setIsFeatureReleased: (featureName: FeatureNameTracked, value: boolean) => Promise<void>;
Signal: any;
}

Loading…
Cancel
Save