From 735ab914d1de4a5c67dca72e64a39a095e318fd9 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Mon, 9 Dec 2024 11:25:28 +1100 Subject: [PATCH 1/3] feat: fetch latest changes from oxen-io repo --- .github/workflows/build-binaries.yml | 3 ++- INTERNALBUILDS.md | 1 - actions/setup_and_build/action.yml | 6 ------ package.json | 4 ++-- ts/components/dialog/OpenUrlModal.tsx | 1 - ts/components/leftpane/ActionsPanel.tsx | 19 +++++++++++++++++-- ts/interactions/conversationInteractions.ts | 2 +- ts/mains/main_node.ts | 9 ++++++++- ts/session/utils/calling/CallManager.ts | 5 +++++ 9 files changed, 35 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build-binaries.yml b/.github/workflows/build-binaries.yml index 507e01178..83dd6a348 100644 --- a/.github/workflows/build-binaries.yml +++ b/.github/workflows/build-binaries.yml @@ -31,6 +31,7 @@ jobs: build_linux: runs-on: ubuntu-20.04 strategy: + fail-fast: false matrix: # this needs to be a valid target of https://www.electron.build/linux#target pkg_to_build: ['deb', 'rpm', 'freebsd', 'AppImage'] @@ -118,7 +119,7 @@ jobs: # We want a mac arm64 build, and according to this https://github.com/actions/runner-images#available-images macos-14 is always arm64 # macos-14 is disabled for now as we hit our free tier limit for macos builds build_macos_x64: - runs-on: macos-12 + runs-on: macos-13 env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} MAC_CERTIFICATE: ${{ secrets.MAC_CERTIFICATE }} diff --git a/INTERNALBUILDS.md b/INTERNALBUILDS.md index 8ab1b3db4..9858a0237 100644 --- a/INTERNALBUILDS.md +++ b/INTERNALBUILDS.md @@ -80,7 +80,6 @@ Building on windows should work straight out of the box, but if it fails then yo ``` npm install --global --production windows-build-tools@4.0.0 -npm install --global node-gyp@latest npm config set python python2.7 npm config set msvs_version 2015 ``` diff --git a/actions/setup_and_build/action.yml b/actions/setup_and_build/action.yml index 5c51a5146..67dae5f09 100644 --- a/actions/setup_and_build/action.yml +++ b/actions/setup_and_build/action.yml @@ -22,12 +22,6 @@ runs: uses: microsoft/setup-msbuild@v2 if: runner.os == 'Windows' - - name: Setup node for windows - if: runner.os == 'Windows' - shell: bash - run: | - yarn global add node-gyp@latest - - uses: actions/cache/restore@v4 id: cache-desktop-modules with: diff --git a/package.json b/package.json index d5b0f2cd6..6ddbd3d53 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "session-desktop", "productName": "Session", "description": "Private messaging from your desktop", - "version": "1.14.2", + "version": "1.14.3", "license": "GPL-3.0", "author": { "name": "Oxen Labs", @@ -10,7 +10,7 @@ }, "repository": { "type": "git", - "url": "https://github.com/oxen-io/session-desktop.git" + "url": "https://github.com/session-foundation/session-desktop.git" }, "main": "ts/mains/main_node.js", "resolutions": { diff --git a/ts/components/dialog/OpenUrlModal.tsx b/ts/components/dialog/OpenUrlModal.tsx index db5ff30f9..de729a32d 100644 --- a/ts/components/dialog/OpenUrlModal.tsx +++ b/ts/components/dialog/OpenUrlModal.tsx @@ -61,7 +61,6 @@ export function OpenUrlModal(props: OpenUrlModalState) { /> { const ourNumber = useSelector(getOurNumber); @@ -238,6 +240,19 @@ export const ActionsPanel = () => { return () => clearTimeout(timeout); }, []); + const globalUnreadMessageCount = useSelector(getGlobalUnreadMessageCount); + + // Reuse the unreadToShow from the global state to update the badge count + useThrottleFn( + (unreadCount: number) => { + if (globalUnreadMessageCount !== undefined) { + ipcRenderer.send('update-badge-count', unreadCount); + } + }, + 2000, + [globalUnreadMessageCount] + ); + useInterval(cleanUpOldDecryptedMedias, startCleanUpMedia ? cleanUpMediasInterval : null); useFetchLatestReleaseFromFileServer(); diff --git a/ts/interactions/conversationInteractions.ts b/ts/interactions/conversationInteractions.ts index 5f0265292..ab483c60d 100644 --- a/ts/interactions/conversationInteractions.ts +++ b/ts/interactions/conversationInteractions.ts @@ -91,7 +91,7 @@ export async function unblockConvoById(conversationId: string) { export const approveConvoAndSendResponse = async (conversationId: string) => { const convoToApprove = getConversationController().get(conversationId); - if (!convoToApprove) { + if (!convoToApprove || convoToApprove.isApproved()) { window?.log?.info('Conversation is already approved.'); return; } diff --git a/ts/mains/main_node.ts b/ts/mains/main_node.ts index 3de057251..e3105124c 100644 --- a/ts/mains/main_node.ts +++ b/ts/mains/main_node.ts @@ -10,6 +10,7 @@ import { dialog, protocol as electronProtocol, ipcMain as ipc, + ipcMain, IpcMainEvent, Menu, nativeTheme, @@ -27,7 +28,7 @@ import { platform as osPlatform } from 'process'; import url from 'url'; import Logger from 'bunyan'; -import _, { isEmpty } from 'lodash'; +import _, { isEmpty, isNumber, isFinite } from 'lodash'; import pify from 'pify'; import { setupGlobalErrorHandler } from '../node/global_errors'; // checked - only node @@ -1019,6 +1020,12 @@ ipc.on('get-start-in-tray', event => { } }); +ipcMain.on('update-badge-count', (_event, count) => { + if (app.isReady()) { + app.setBadgeCount(isNumber(count) && isFinite(count) && count >= 0 ? count : 0); + } +}); + ipc.on('get-opengroup-pruning', event => { try { const val = userConfig.get('opengroupPruning'); diff --git a/ts/session/utils/calling/CallManager.ts b/ts/session/utils/calling/CallManager.ts index 862b40919..62fa76d2b 100644 --- a/ts/session/utils/calling/CallManager.ts +++ b/ts/session/utils/calling/CallManager.ts @@ -35,6 +35,7 @@ import { MessageSender } from '../../sending'; import { getIsRinging } from '../RingingManager'; import { getBlackSilenceMediaStream } from './Silence'; import { ed25519Str } from '../String'; +import { sleepFor } from '../Promise'; export type InputItem = { deviceId: string; label: string }; @@ -534,6 +535,10 @@ export async function USER_callRecipient(recipient: string) { calledConvo.set('active_at', Date.now()); // addSingleOutgoingMessage does the commit for us on the convo await calledConvo.unhideIfNeeded(false); weAreCallerOnCurrentCall = true; + // Not ideal, but also temporary (see you in 2 years). + // We need to make sure the preoffer AND the messageRequestResponse sent in + // approveConvoAndSendResponse have different timestamps, as iOS will throw an error otherwise + await sleepFor(2); // initiating a call is analogous to sending a message request await approveConvoAndSendResponse(recipient); From 36658f23d2e942ccaff47f5fe0cbe174ef9bb36c Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Wed, 18 Dec 2024 16:07:51 +1100 Subject: [PATCH 2/3] fix: use valid timestamp format string for documents --- ts/components/conversation/media-gallery/DocumentListItem.tsx | 2 +- ts/mains/main_node.ts | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/ts/components/conversation/media-gallery/DocumentListItem.tsx b/ts/components/conversation/media-gallery/DocumentListItem.tsx index 3dcd53e99..3a8d491a9 100644 --- a/ts/components/conversation/media-gallery/DocumentListItem.tsx +++ b/ts/components/conversation/media-gallery/DocumentListItem.tsx @@ -63,7 +63,7 @@ export const DocumentListItem = (props: Props) => {
- {formatDateWithLocale({ date: new Date(timestamp), formatStr: 'ddd, MMM D, Y' })} + {formatDateWithLocale({ date: new Date(timestamp), formatStr: 'd LLL, yyyy' })}
diff --git a/ts/mains/main_node.ts b/ts/mains/main_node.ts index cd4ba2a3f..e3105124c 100644 --- a/ts/mains/main_node.ts +++ b/ts/mains/main_node.ts @@ -1022,9 +1022,7 @@ ipc.on('get-start-in-tray', event => { ipcMain.on('update-badge-count', (_event, count) => { if (app.isReady()) { - app.setBadgeCount( - isNumber(count) && isFinite(count) && count >= 0 ? count : 0 - ); + app.setBadgeCount(isNumber(count) && isFinite(count) && count >= 0 ? count : 0); } }); From dc023d5f2b0ab21e45eaccdbcdcdf07e25cd076d Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Thu, 19 Dec 2024 17:33:35 +1100 Subject: [PATCH 3/3] chore: bump to 1.14.5 first official release on session-foundation repo --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6ddbd3d53..db91f1d02 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "session-desktop", "productName": "Session", "description": "Private messaging from your desktop", - "version": "1.14.3", + "version": "1.14.5", "license": "GPL-3.0", "author": { "name": "Oxen Labs",