From 1cff5e467fe78d9e49960e4b3dff3464c8fc72f5 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Thu, 17 Aug 2023 14:18:39 +1000 Subject: [PATCH 1/5] chore: fix for latest notarize tools from apple they expect a teamId field now --- build/notarize.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build/notarize.js b/build/notarize.js index ca8551f44..6e05292dc 100644 --- a/build/notarize.js +++ b/build/notarize.js @@ -34,6 +34,9 @@ exports.default = async function notarizing(context) { appleId: SIGNING_APPLE_ID, appleIdPassword: SIGNING_APP_PASSWORD, }; - if (!isEmpty(SIGNING_TEAM_ID)) options.ascProvider = SIGNING_TEAM_ID; + if (!isEmpty(SIGNING_TEAM_ID)) { + options.ascProvider = SIGNING_TEAM_ID; + options.teamId = SIGNING_TEAM_ID; + } return notarize(options); }; From 3c8ab8906a0ba1ad110b0ce06eead9c0fc8d9e27 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Thu, 17 Aug 2023 14:46:33 +1000 Subject: [PATCH 2/5] chore: add featureFlag for integrationtestenv derived from process.env --- preload.js | 3 +++ ts/types/attachments/VisualAttachment.ts | 2 +- ts/window.d.ts | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/preload.js b/preload.js index 3ddc14cc4..643e7938f 100644 --- a/preload.js +++ b/preload.js @@ -31,6 +31,9 @@ window.sessionFeatureFlags = { useTestNet: Boolean( process.env.NODE_APP_INSTANCE && process.env.NODE_APP_INSTANCE.includes('testnet') ), + integrationTestEnv: Boolean( + process.env.NODE_APP_INSTANCE && process.env.NODE_APP_INSTANCE.includes('test-integration') + ), useClosedGroupV3: false || process.env.USE_CLOSED_GROUP_V3, debug: { debugLogging: !_.isEmpty(process.env.SESSION_DEBUG), diff --git a/ts/types/attachments/VisualAttachment.ts b/ts/types/attachments/VisualAttachment.ts index 3bec31a77..3d24d52c4 100644 --- a/ts/types/attachments/VisualAttachment.ts +++ b/ts/types/attachments/VisualAttachment.ts @@ -140,7 +140,7 @@ export async function autoScaleAvatarBlob(file: File) { * Shows the system file picker for images, scale the image down for avatar/opengroup measurements and return the blob objectURL on success */ export async function pickFileForAvatar(): Promise { - if (process.env.NODE_APP_INSTANCE?.includes('test-integration')) { + if (window.sessionFeatureFlags.integrationTestEnv) { window.log.info( 'shorting pickFileForAvatar as it does not work in playwright/notsending the filechooser event' ); diff --git a/ts/window.d.ts b/ts/window.d.ts index 143e45d96..2e5da8494 100644 --- a/ts/window.d.ts +++ b/ts/window.d.ts @@ -34,6 +34,7 @@ declare global { useOnionRequests: boolean; useTestNet: boolean; useClosedGroupV3: boolean; + integrationTestEnv: boolean; debug: { debugLogging: boolean; debugLibsessionDumps: boolean; From e2a778cf40d448b9e91c93c59afbcf0933db9eba Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Thu, 17 Aug 2023 14:47:41 +1000 Subject: [PATCH 3/5] chore: bump to session 1.11.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 21017d061..9ee4947b6 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "session-desktop", "productName": "Session", "description": "Private messaging from your desktop", - "version": "1.11.0", + "version": "1.11.1", "license": "GPL-3.0", "author": { "name": "Oxen Labs", From 1dd61aabeb75b671b8ea26328c35c4ad9f993207 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Fri, 18 Aug 2023 14:06:26 +1000 Subject: [PATCH 4/5] fix: hide public admin actions on non public chats --- .eslintignore | 1 + .../message/message-content/MessageContextMenu.tsx | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.eslintignore b/.eslintignore index da77f07f0..cd371d9ae 100644 --- a/.eslintignore +++ b/.eslintignore @@ -14,3 +14,4 @@ preload.js stylesheets/dist/ compiled.d.ts .eslintrc.js +playwright.config.js diff --git a/ts/components/conversation/message/message-content/MessageContextMenu.tsx b/ts/components/conversation/message/message-content/MessageContextMenu.tsx index 407ee8220..7591a9ac6 100644 --- a/ts/components/conversation/message/message-content/MessageContextMenu.tsx +++ b/ts/components/conversation/message/message-content/MessageContextMenu.tsx @@ -48,6 +48,7 @@ import { useMessageStatus, useMessageTimestamp, } from '../../../../state/selectors'; +import { useIsPublic } from '../../../../hooks/useParamSelector'; export type MessageContextMenuSelectorProps = Pick< MessageRenderingProps, @@ -148,10 +149,10 @@ const SaveAttachment = ({ messageId }: MessageId) => { const AdminActionItems = ({ messageId }: MessageId) => { const convoId = useSelectedConversationKey(); - + const isPublic = useIsPublic(); const weAreModerator = useSelectedWeAreModerator(); const weAreAdmin = useSelectedWeAreAdmin(); - const showAdminActions = weAreAdmin || weAreModerator; + const showAdminActions = (weAreAdmin || weAreModerator) && isPublic; const sender = useMessageSender(messageId); const isSenderAdmin = useMessageSenderIsAdmin(messageId); From e3b6be731819160f3e58f0a9677e27a4555aa5ef Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Fri, 18 Aug 2023 14:17:28 +1000 Subject: [PATCH 5/5] chore: fix typos this comes from mdplusplus https://github.com/mdPlusPlus/session-desktop/tree/codespell duplicated to fix conflicts --- background.html | 2 +- password.html | 2 +- ts/components/SessionContextMenuContainer.tsx | 2 +- ts/components/button/MenuButton.tsx | 2 +- ts/models/messageType.ts | 2 +- ts/node/sql.ts | 2 +- ts/session/apis/open_group_api/sogsv3/sogsApiV3.ts | 2 +- ts/session/apis/snode_api/getSwarmFor.ts | 2 +- ts/session/apis/snode_api/swarmPolling.ts | 2 +- ts/session/group/closed-group.ts | 2 +- ts/session/messages/outgoing/visibleMessage/VisibleMessage.ts | 2 +- ts/session/sending/MessageQueue.ts | 2 +- ts/session/utils/libsession/libsession_utils_contacts.ts | 4 ++-- 13 files changed, 14 insertions(+), 14 deletions(-) diff --git a/background.html b/background.html index 58d9afd64..2c8343a22 100644 --- a/background.html +++ b/background.html @@ -24,7 +24,7 @@ style-src 'self' 'unsafe-inline';" /> Session - + diff --git a/password.html b/password.html index 593a4c1d3..40e231221 100644 --- a/password.html +++ b/password.html @@ -23,7 +23,7 @@ script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline';" /> - + diff --git a/ts/components/SessionContextMenuContainer.tsx b/ts/components/SessionContextMenuContainer.tsx index 1aaacc48a..62b08808c 100644 --- a/ts/components/SessionContextMenuContainer.tsx +++ b/ts/components/SessionContextMenuContainer.tsx @@ -4,7 +4,7 @@ export const SessionContextMenuContainer = styled.div.attrs({ // custom props })` .react-contexify { - // be sure it is more than the one set for the More Informations screen of messages + // be sure it is more than the one set for the More Information screen of messages z-index: 30; min-width: 200px; box-shadow: 0px 0px 10px var(--context-menu-shadow-color) !important; diff --git a/ts/components/button/MenuButton.tsx b/ts/components/button/MenuButton.tsx index 07852d7d6..c07729e0c 100644 --- a/ts/components/button/MenuButton.tsx +++ b/ts/components/button/MenuButton.tsx @@ -27,7 +27,7 @@ const StyledMenuButton = styled.button` `; /** - * This is the Session Menu Botton. i.e. the button on top of the conversation list to start a new conversation. + * This is the Session Menu Button. i.e. the button on top of the conversation list to start a new conversation. * It has two state: selected or not and so we use an checkbox input to keep the state in sync. */ export const MenuButton = () => { diff --git a/ts/models/messageType.ts b/ts/models/messageType.ts index 74728ba2d..eebcb0596 100644 --- a/ts/models/messageType.ts +++ b/ts/models/messageType.ts @@ -228,7 +228,7 @@ export const fillMessageAttributesWithDefaults = ( id: uuidv4(), unread: READ_MESSAGE_STATE.read, // if nothing is set, this message is considered read }); - // this is just to cleanup a bit the db. delivered and delivered_to were removed, so everytime we load a message + // this is just to cleanup a bit the db. delivered and delivered_to were removed, so every time we load a message // we make sure to clean those fields in the json. // the next commit() will write that to the disk if (defaulted.delivered) { diff --git a/ts/node/sql.ts b/ts/node/sql.ts index 7b1d5d5f3..2964865b8 100644 --- a/ts/node/sql.ts +++ b/ts/node/sql.ts @@ -409,7 +409,7 @@ function getConversationCount() { /** * Because the argument list can change when saving a conversation (and actually doing a lot of other stuff), * it is not a good idea to try to use it to update a conversation while doing migrations. - * Because everytime you'll update the saveConversation with a new argument, the migration you wrote a month ago still relies on the old way. + * Because every time you'll update the saveConversation with a new argument, the migration you wrote a month ago still relies on the old way. * Because of that, there is no `instance` argument here, and you should not add one as this is only needed during migrations (which will break if you do it) */ diff --git a/ts/session/apis/open_group_api/sogsv3/sogsApiV3.ts b/ts/session/apis/open_group_api/sogsv3/sogsApiV3.ts index d76c94e4b..6a110d873 100644 --- a/ts/session/apis/open_group_api/sogsv3/sogsApiV3.ts +++ b/ts/session/apis/open_group_api/sogsv3/sogsApiV3.ts @@ -560,7 +560,7 @@ export const handleBatchPollResults = async ( case 'updateRoom': case 'deleteReaction': // we do nothing for all of those, but let's make sure if we ever add something batch polled for, we include it's handling here. - // the assertUnreachable will fail to compile everytime we add a new batch poll endpoint without taking care of it. + // the assertUnreachable will fail to compile every time we add a new batch poll endpoint without taking care of it. break; default: assertUnreachable( diff --git a/ts/session/apis/snode_api/getSwarmFor.ts b/ts/session/apis/snode_api/getSwarmFor.ts index d9561be6a..3b881e5e7 100644 --- a/ts/session/apis/snode_api/getSwarmFor.ts +++ b/ts/session/apis/snode_api/getSwarmFor.ts @@ -83,7 +83,7 @@ async function requestSnodesForPubkeyWithTargetNode( async function requestSnodesForPubkeyRetryable(pubKey: string): Promise> { // don't catch exception in here. we want them to bubble up - // this is the level where our targetNode is not yet known. We retry a few times with a new one everytime. + // this is the level where our targetNode is not yet known. We retry a few times with a new one every time. // the idea is that the requestSnodesForPubkeyWithTargetNode will remove a failing targetNode return pRetry( async () => { diff --git a/ts/session/apis/snode_api/swarmPolling.ts b/ts/session/apis/snode_api/swarmPolling.ts index f185edee0..2b7052d67 100644 --- a/ts/session/apis/snode_api/swarmPolling.ts +++ b/ts/session/apis/snode_api/swarmPolling.ts @@ -91,7 +91,7 @@ export class SwarmPolling { } /** - * Used fo testing only + * Used for testing only */ public resetSwarmPolling() { this.groupPolling = []; diff --git a/ts/session/group/closed-group.ts b/ts/session/group/closed-group.ts index 990476614..8094c810c 100644 --- a/ts/session/group/closed-group.ts +++ b/ts/session/group/closed-group.ts @@ -427,7 +427,7 @@ async function generateAndSendNewEncryptionKeyPair( await groupConvo?.commit(); // this makes sure to include the new encryption keypair in the libsession usergroup wrapper }; - // this is to be sent to the group pubkey adress + // this is to be sent to the group pubkey address await getMessageQueue().sendToGroup({ message: keypairsMessage, namespace: SnodeNamespaces.ClosedGroupMessage, diff --git a/ts/session/messages/outgoing/visibleMessage/VisibleMessage.ts b/ts/session/messages/outgoing/visibleMessage/VisibleMessage.ts index 43e718dc5..db68a7cdb 100644 --- a/ts/session/messages/outgoing/visibleMessage/VisibleMessage.ts +++ b/ts/session/messages/outgoing/visibleMessage/VisibleMessage.ts @@ -200,7 +200,7 @@ export function buildProfileForOutgoingMessage(params: { lokiProfile?: LokiProfi const displayName = params.lokiProfile?.displayName; - // no need to iclude the avatarPointer if there is no profileKey associated with it. + // no need to include the avatarPointer if there is no profileKey associated with it. const avatarPointer = params.lokiProfile?.avatarPointer && !isEmpty(profileKey) && diff --git a/ts/session/sending/MessageQueue.ts b/ts/session/sending/MessageQueue.ts index 97a0009cd..939bd5ea9 100644 --- a/ts/session/sending/MessageQueue.ts +++ b/ts/session/sending/MessageQueue.ts @@ -330,7 +330,7 @@ export class MessageQueue { const us = UserUtils.getOurPubKeyFromCache(); let isSyncMessage = false; if (us && destinationPk.isEqual(us)) { - // We allow a message for ourselve only if it's a ConfigurationMessage, a ClosedGroupNewMessage, + // We allow a message for ourselves only if it's a ConfigurationMessage, a ClosedGroupNewMessage, // or a message with a syncTarget set. if (MessageSender.isSyncMessage(message)) { diff --git a/ts/session/utils/libsession/libsession_utils_contacts.ts b/ts/session/utils/libsession/libsession_utils_contacts.ts index 01d95a471..0db5442c3 100644 --- a/ts/session/utils/libsession/libsession_utils_contacts.ts +++ b/ts/session/utils/libsession/libsession_utils_contacts.ts @@ -10,9 +10,9 @@ import { PubKey } from '../../types'; * It allows to make changes to the wrapper and keeps track of the decoded values of those in the in-memory cache named `mappedContactWrapperValues`. * * The wrapper content is just a blob which has no structure. - * Rather than having to fetch the required data from it everytime we need it (during each rerendering), we keep a decoded cache here. + * Rather than having to fetch the required data from it every time we need it (during each rerendering), we keep a decoded cache here. * Essentially, on app start we load all the content from the wrapper with `SessionUtilContact.refreshMappedValue` during the ConversationController initial load. - * Then, everytime we do a change to the contacts wrapper, we do it through `insertContactFromDBIntoWrapperAndRefresh`. + * Then, every time we do a change to the contacts wrapper, we do it through `insertContactFromDBIntoWrapperAndRefresh`. * This applies the change from the in-memory conversationModel to the ContactsWrapper, refetch the data from it and update the decoded cache `mappedContactWrapperValues` with the up to date data. * It then triggers a UI refresh of that specific conversation with `triggerUIRefresh` to make sure whatever is displayed on screen is still up to date with the wrapper content. *