Skip to content

Commit 8540aa6

Browse files
committed
Merge remote-tracking branch 'upstream/dev' into chore-replace-i18n-calls
2 parents b649844 + 7a91838 commit 8540aa6

File tree

12 files changed

+53
-120
lines changed

12 files changed

+53
-120
lines changed

preload.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ window.sessionFeatureFlags = {
5858
// Hooks
5959
useClosedGroupV2QAButtons: false, // TODO DO NOT MERGE
6060
useOnionRequests: true,
61-
useReleaseChannels: true,
62-
useSESH101: true,
6361
useTestNet: isTestNet() || isTestIntegration(),
6462
debugInputCommands: !isEmpty(process.env.SESSION_DEBUG),
6563
alwaysShowRemainingChars: false,

ts/components/SessionWrapperModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const StyledModalHeader = styled(Flex)<{ bigHeader?: boolean; scrolled: boolean
4545

4646
export enum WrapperModalWidth {
4747
narrow = '350px',
48-
normal = '410px',
48+
normal = '420px',
4949
wide = '500px',
5050
debug = '75%',
5151
}

ts/components/conversation/composition/CompositionBox.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -821,6 +821,7 @@ class CompositionBoxInner extends Component<Props, State> {
821821
stagedLinkPreview: undefined,
822822
ignoredLink: undefined,
823823
draft: '',
824+
characterCount: 0,
824825
});
825826
updateDraftForConversation({
826827
conversationKey: this.props.selectedConversationKey,

ts/components/conversation/composition/CompositionInput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ const UnstyledCompositionInput = forwardRef<CompositionInputRef, ContentEditable
694694
const _onKeyDown = useCallback(
695695
(e: KeyboardEvent<HTMLDivElement>) => {
696696
if (e.ctrlKey || e.metaKey) {
697-
if (e.key === 'y' || (e.key === 'Z' && e.shiftKey)) {
697+
if (e.key === 'y' || (e.shiftKey && (e.key === 'z' || e.key === 'Z'))) {
698698
// Ctrl+Y or Cmd+Y
699699
// Ctrl+Shift+Z or Cmd+Shift+Z
700700
e.preventDefault();

ts/components/dialog/SessionProInfoModal.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,14 @@ export enum SessionProInfoVariant {
3636
const StyledContentContainer = styled.div`
3737
display: flex;
3838
flex-direction: column;
39-
margin-bottom: var(--margins-lg);
39+
margin-bottom: var(--margins-md);
4040
gap: var(--margins-sm);
4141
`;
4242

4343
const StyledScrollDescriptionContainer = styled.div`
4444
text-align: center;
4545
font-size: var(--font-size-lg);
46+
line-height: var(--font-size-xl);
4647
color: var(--text-secondary-color);
4748
`;
4849

ts/components/dialog/debug/ReleaseChannel.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ const items = [
2424
export const ReleaseChannel = () => {
2525
const { releaseChannel, setReleaseChannel } = useReleaseChannel();
2626

27-
if (!window.sessionFeatureFlags.useReleaseChannels) {
28-
return null;
29-
}
30-
3127
return (
3228
<Flex
3329
$container={true}

ts/components/dialog/debug/components.tsx

Lines changed: 21 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,6 @@ import { ConversationTypeEnum } from '../../../models/types';
3232
import { ContactsWrapperActions } from '../../../webworker/workers/browser/libsession_worker_interface';
3333
import { usePolling } from '../../../hooks/usePolling';
3434
import { releasedFeaturesActions } from '../../../state/ducks/releasedFeatures';
35-
import {
36-
useReleasedFeaturesRefreshedAt,
37-
useSesh101NotificationAt,
38-
} from '../../../state/selectors/releasedFeatures';
39-
import { formatAbbreviatedExpireDoubleTimer } from '../../../util/i18n/formatting/expirationTimer';
40-
import { handleReleaseNotification } from '../../../util/releasedFeatures';
4135
import { networkDataActions } from '../../../state/ducks/networkData';
4236
import { DEBUG_MENU_PAGE, type DebugMenuPageProps } from './DebugMenuModal';
4337
import { SimpleSessionInput } from '../../inputs/SessionInput';
@@ -327,9 +321,7 @@ export const DebugActions = () => {
327321
</SessionButton>
328322
<CheckForUpdatesButton />
329323
<CheckVersionButton channelToCheck="stable" />
330-
{window.sessionFeatureFlags.useReleaseChannels ? (
331-
<CheckVersionButton channelToCheck="alpha" />
332-
) : null}
324+
<CheckVersionButton channelToCheck="alpha" />
333325
<SessionButton
334326
width="180px"
335327
onClick={async () => {
@@ -347,12 +339,11 @@ export const DebugActions = () => {
347339

348340
export const ExperimentalActions = ({ forceUpdate }: { forceUpdate: () => void }) => {
349341
const dispatch = useDispatch();
350-
const refreshedAt = useReleasedFeaturesRefreshedAt();
351-
const sesh101NotificationAt = useSesh101NotificationAt();
352-
353-
const [countdown, setCountdown] = useState(false);
342+
// const refreshedAt = useReleasedFeaturesRefreshedAt();
343+
// const sesh101NotificationAt = useSesh101NotificationAt();
354344

355-
const timeLeftMs = sesh101NotificationAt - Date.now();
345+
// const [countdown, setCountdown] = useState(false);
346+
// const timeLeftMs = sesh101NotificationAt - Date.now();
356347

357348
// TODO [SES-2606] uncomment before release but after QA
358349
// if (!process.env.SESSION_DEV) {
@@ -379,31 +370,22 @@ export const ExperimentalActions = ({ forceUpdate }: { forceUpdate: () => void }
379370
>
380371
Reset experiments
381372
</SessionButton>
382-
{window.sessionFeatureFlags.useSESH101 ? (
383-
<SessionButton
384-
onClick={() => {
385-
const notifyAt = handleReleaseNotification({
386-
featureName: 'useSESH101',
387-
message: tr('sessionNetworkNotificationLive'),
388-
lastRefreshedAt: refreshedAt,
389-
notifyAt: sesh101NotificationAt,
390-
delayMs: 10 * DURATION.SECONDS,
391-
force: true,
392-
});
393-
dispatch(releasedFeaturesActions.updateSesh101NotificationAt(notifyAt));
394-
setCountdown(true);
395-
}}
396-
>
397-
Notify Sesh 101
398-
<span style={{ marginInlineStart: 'var(--margins-xs)' }}>
399-
{countdown
400-
? Math.floor(timeLeftMs / 1000) > 0
401-
? `(${formatAbbreviatedExpireDoubleTimer(Math.floor(timeLeftMs / 1000))})`
402-
: '🎉'
403-
: '(10s)'}
404-
</span>
405-
</SessionButton>
406-
) : null}
373+
374+
{/* <SessionButton
375+
onClick={() => {
376+
dispatch(releasedFeaturesActions.updateSesh101NotificationAt(notifyAt));
377+
setCountdown(true);
378+
}}
379+
>
380+
Notify Sesh 101
381+
<span style={{ marginInlineStart: 'var(--margins-xs)' }}>
382+
{countdown
383+
? Math.floor(timeLeftMs / 1000) > 0
384+
? `(${formatAbbreviatedExpireDoubleTimer(Math.floor(timeLeftMs / 1000))})`
385+
: '🎉'
386+
: '(10s)'}
387+
</span>
388+
</SessionButton> */}
407389
<SessionButton
408390
onClick={() => {
409391
dispatch(networkDataActions.fetchInfoFromSeshServer() as any);

ts/components/leftpane/ActionsPanel.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ import { MessageQueue } from '../../session/sending';
5858
import { useCheckReleasedFeatures } from '../../hooks/useCheckReleasedFeatures';
5959
import { useDebugMode } from '../../state/selectors/debug';
6060
import { networkDataActions } from '../../state/ducks/networkData';
61-
import { isSesh101ReadyOutsideRedux } from '../../state/selectors/releasedFeatures';
6261
import { searchActions } from '../../state/ducks/search';
6362
import { LUCIDE_ICONS_UNICODE } from '../icon/lucide';
6463

@@ -224,9 +223,7 @@ const doAppStartUp = async () => {
224223
// eslint-disable-next-line more/no-then
225224
void SnodePool.getFreshSwarmFor(UserUtils.getOurPubKeyStrFromCache()).then(() => {
226225
// trigger any other actions that need to be done after the swarm is ready
227-
if (isSesh101ReadyOutsideRedux()) {
228-
window.inboxStore?.dispatch(networkDataActions.fetchInfoFromSeshServer() as any);
229-
}
226+
window.inboxStore?.dispatch(networkDataActions.fetchInfoFromSeshServer() as any);
230227
}); // refresh our swarm on start to speed up the first message fetching event
231228
void Data.cleanupOrphanedAttachments();
232229

ts/receiver/queuedJob.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -304,11 +304,13 @@ async function handleRegularMessage(
304304

305305
handleLinkPreviews(rawDataMessage.body, rawDataMessage.preview, message);
306306

307-
// TODO: add pro status check for sender
308-
const isSenderPro = false;
309-
const maxChars = isSenderPro
310-
? Constants.CONVERSATION.MAX_MESSAGE_CHAR_COUNT_PRO
311-
: Constants.CONVERSATION.MAX_MESSAGE_CHAR_COUNT_STANDARD;
307+
// TODO: Once pro proof validation is available make this dynamic
308+
// const maxChars = isSenderPro
309+
// ? Constants.CONVERSATION.MAX_MESSAGE_CHAR_COUNT_PRO
310+
// : Constants.CONVERSATION.MAX_MESSAGE_CHAR_COUNT_STANDARD;
311+
// NOTE: The truncation value must be the Pro count so when Pro is released older clients wont truncate pro messages.
312+
const maxChars = Constants.CONVERSATION.MAX_MESSAGE_CHAR_COUNT_PRO;
313+
312314
const body =
313315
rawDataMessage.body.length > maxChars
314316
? rawDataMessage.body.slice(0, maxChars)

ts/state/ducks/releasedFeatures.tsx

Lines changed: 19 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,23 @@
11
import { createAsyncThunk, createSlice, type PayloadAction } from '@reduxjs/toolkit';
22
import { ToastUtils } from '../../session/utils';
33
import { Storage } from '../../util/storage';
4-
import { DURATION } from '../../session/constants';
5-
import { isValidUnixTimestamp } from '../../session/utils/Timestamps';
6-
import { handleReleaseNotification } from '../../util/releasedFeatures';
7-
import { tr } from '../../localization/localeTools';
84

95
export interface ReleasedFeaturesState {
106
refreshedAt: number;
11-
sesh101Ready: boolean;
12-
sesh101NotificationAt: number;
137
}
148

159
export const initialReleasedFeaturesState = {
1610
refreshedAt: Date.now(),
17-
sesh101Ready: window.sessionFeatureFlags.useSESH101,
18-
sesh101NotificationAt: 0,
1911
};
2012

2113
// #region - Async Thunks
2214

2315
// NOTE as features are released in production they will be removed from this list
2416
const resetExperiments = createAsyncThunk(
2517
'releasedFeatures/resetExperiments',
26-
async (_, payloadCreator): Promise<void> => {
27-
// reset the feature flags
28-
window.sessionFeatureFlags.useReleaseChannels = false;
29-
window.sessionFeatureFlags.useSESH101 = false;
30-
18+
async (_, _payloadCreator): Promise<void> => {
3119
// reset the redux state
32-
payloadCreator.dispatch(releasedFeaturesActions.updateSesh101Ready(false));
33-
payloadCreator.dispatch(releasedFeaturesActions.updateSesh101NotificationAt(0));
20+
// payloadCreator.dispatch(releasedFeaturesActions.updateSesh101NotificationAt(0));
3421

3522
// reset the storage
3623
await Storage.remove(`releaseNotification-useSESH101`);
@@ -58,35 +45,28 @@ const releasedFeaturesSlice = createSlice({
5845
const { refreshedAt } = action.payload;
5946

6047
state.refreshedAt = refreshedAt;
61-
state.sesh101Ready = window.sessionFeatureFlags.useSESH101;
6248

63-
if (state.sesh101Ready) {
64-
state.sesh101NotificationAt = handleReleaseNotification({
65-
featureName: 'useSESH101',
66-
message: tr('sessionNetworkNotificationLive'),
67-
lastRefreshedAt: state.refreshedAt,
68-
notifyAt: state.sesh101NotificationAt,
69-
delayMs: 1 * DURATION.HOURS,
70-
});
71-
}
49+
// state.sesh101NotificationAt = handleReleaseNotification({
50+
// featureName: 'useSESH101',
51+
// message: tr('sessionNetworkNotificationLive').toString(),
52+
// lastRefreshedAt: state.refreshedAt,
53+
// notifyAt: state.sesh101NotificationAt,
54+
// delayMs: 1 * DURATION.HOURS,
55+
// });
7256

7357
return state;
7458
},
75-
updateSesh101Ready: (state, action: PayloadAction<boolean>) => {
76-
state.sesh101Ready = action.payload;
77-
return state;
78-
},
79-
updateSesh101NotificationAt(state, action: PayloadAction<number>) {
80-
if (isValidUnixTimestamp(action.payload)) {
81-
state.sesh101NotificationAt = action.payload;
82-
} else {
83-
window.log.error(
84-
`[releasedFeatures/updateSesh101NotificationAt] invalid timestamp ${action.payload}`
85-
);
86-
}
59+
// updateSesh101NotificationAt(state, action: PayloadAction<number>) {
60+
// if (isValidUnixTimestamp(action.payload)) {
61+
// state.sesh101NotificationAt = action.payload;
62+
// } else {
63+
// window.log.error(
64+
// `[releasedFeatures/updateSesh101NotificationAt] invalid timestamp ${action.payload}`
65+
// );
66+
// }
8767

88-
return state;
89-
},
68+
// return state;
69+
// },
9070
},
9171
extraReducers: builder => {
9272
builder.addCase(resetExperiments.fulfilled, (_state, _action) => {

0 commit comments

Comments
 (0)