Merge branch 'unstable' into userconfig_disappearingmessage

pull/2971/head
William Grant 2 years ago
commit da588a1096

@ -14,3 +14,4 @@ preload.js
stylesheets/dist/ stylesheets/dist/
compiled.d.ts compiled.d.ts
.eslintrc.js .eslintrc.js
playwright.config.js

@ -24,7 +24,7 @@
style-src 'self' 'unsafe-inline';" style-src 'self' 'unsafe-inline';"
/> />
<title>Session</title> <title>Session</title>
<link href="images/sesion/session_icon_128.png" rel="shortcut icon" /> <link href="images/session/session_icon.png" rel="shortcut icon" />
<link href="stylesheets/dist/manifest.css" rel="stylesheet" type="text/css" /> <link href="stylesheets/dist/manifest.css" rel="stylesheet" type="text/css" />
</head> </head>

@ -34,6 +34,9 @@ exports.default = async function notarizing(context) {
appleId: SIGNING_APPLE_ID, appleId: SIGNING_APPLE_ID,
appleIdPassword: SIGNING_APP_PASSWORD, 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); return notarize(options);
}; };

@ -2,7 +2,7 @@
"name": "session-desktop", "name": "session-desktop",
"productName": "Session", "productName": "Session",
"description": "Private messaging from your desktop", "description": "Private messaging from your desktop",
"version": "1.11.0", "version": "1.11.1",
"license": "GPL-3.0", "license": "GPL-3.0",
"author": { "author": {
"name": "Oxen Labs", "name": "Oxen Labs",

@ -23,7 +23,7 @@
script-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline';
style-src 'self' 'unsafe-inline';" style-src 'self' 'unsafe-inline';"
/> />
<link href="images/sesion/session_icon_128.png" rel="shortcut icon" /> <link href="images/session/session_icon.png" rel="shortcut icon" />
<link href="stylesheets/dist/manifest.css" rel="stylesheet" type="text/css" /> <link href="stylesheets/dist/manifest.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>

@ -31,6 +31,9 @@ window.sessionFeatureFlags = {
useTestNet: Boolean( useTestNet: Boolean(
process.env.NODE_APP_INSTANCE && process.env.NODE_APP_INSTANCE.includes('testnet') 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, useClosedGroupV3: false || process.env.USE_CLOSED_GROUP_V3,
debug: { debug: {
debugLogging: !_.isEmpty(process.env.SESSION_DEBUG), debugLogging: !_.isEmpty(process.env.SESSION_DEBUG),

@ -4,7 +4,7 @@ export const SessionContextMenuContainer = styled.div.attrs({
// custom props // custom props
})` })`
.react-contexify { .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; z-index: 30;
min-width: 200px; min-width: 200px;
box-shadow: 0px 0px 10px var(--context-menu-shadow-color) !important; box-shadow: 0px 0px 10px var(--context-menu-shadow-color) !important;

@ -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. * It has two state: selected or not and so we use an checkbox input to keep the state in sync.
*/ */
export const MenuButton = () => { export const MenuButton = () => {

@ -48,6 +48,7 @@ import {
useMessageStatus, useMessageStatus,
useMessageTimestamp, useMessageTimestamp,
} from '../../../../state/selectors'; } from '../../../../state/selectors';
import { useIsPublic } from '../../../../hooks/useParamSelector';
export type MessageContextMenuSelectorProps = Pick< export type MessageContextMenuSelectorProps = Pick<
MessageRenderingProps, MessageRenderingProps,
@ -148,10 +149,10 @@ const SaveAttachment = ({ messageId }: MessageId) => {
const AdminActionItems = ({ messageId }: MessageId) => { const AdminActionItems = ({ messageId }: MessageId) => {
const convoId = useSelectedConversationKey(); const convoId = useSelectedConversationKey();
const isPublic = useIsPublic();
const weAreModerator = useSelectedWeAreModerator(); const weAreModerator = useSelectedWeAreModerator();
const weAreAdmin = useSelectedWeAreAdmin(); const weAreAdmin = useSelectedWeAreAdmin();
const showAdminActions = weAreAdmin || weAreModerator; const showAdminActions = (weAreAdmin || weAreModerator) && isPublic;
const sender = useMessageSender(messageId); const sender = useMessageSender(messageId);
const isSenderAdmin = useMessageSenderIsAdmin(messageId); const isSenderAdmin = useMessageSenderIsAdmin(messageId);

@ -237,7 +237,7 @@ export const fillMessageAttributesWithDefaults = (
id: uuidv4(), id: uuidv4(),
unread: READ_MESSAGE_STATE.read, // if nothing is set, this message is considered read 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. // we make sure to clean those fields in the json.
// the next commit() will write that to the disk // the next commit() will write that to the disk
if (defaulted.delivered) { if (defaulted.delivered) {

@ -409,7 +409,7 @@ function getConversationCount() {
/** /**
* Because the argument list can change when saving a conversation (and actually doing a lot of other stuff), * 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. * 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) * 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)
*/ */

@ -560,7 +560,7 @@ export const handleBatchPollResults = async (
case 'updateRoom': case 'updateRoom':
case 'deleteReaction': 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. // 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; break;
default: default:
assertUnreachable( assertUnreachable(

@ -83,7 +83,7 @@ async function requestSnodesForPubkeyWithTargetNode(
async function requestSnodesForPubkeyRetryable(pubKey: string): Promise<Array<Snode>> { async function requestSnodesForPubkeyRetryable(pubKey: string): Promise<Array<Snode>> {
// don't catch exception in here. we want them to bubble up // 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 // the idea is that the requestSnodesForPubkeyWithTargetNode will remove a failing targetNode
return pRetry( return pRetry(
async () => { async () => {

@ -91,7 +91,7 @@ export class SwarmPolling {
} }
/** /**
* Used fo testing only * Used for testing only
*/ */
public resetSwarmPolling() { public resetSwarmPolling() {
this.groupPolling = []; this.groupPolling = [];

@ -458,7 +458,7 @@ async function generateAndSendNewEncryptionKeyPair(
await groupConvo?.commit(); // this makes sure to include the new encryption keypair in the libsession usergroup wrapper 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({ await getMessageQueue().sendToGroup({
message: keypairsMessage, message: keypairsMessage,
namespace: SnodeNamespaces.ClosedGroupMessage, namespace: SnodeNamespaces.ClosedGroupMessage,

@ -204,7 +204,7 @@ export function buildProfileForOutgoingMessage(params: { lokiProfile?: LokiProfi
const displayName = params.lokiProfile?.displayName; 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 = const avatarPointer =
params.lokiProfile?.avatarPointer && params.lokiProfile?.avatarPointer &&
!isEmpty(profileKey) && !isEmpty(profileKey) &&

@ -330,7 +330,7 @@ export class MessageQueue {
const us = UserUtils.getOurPubKeyFromCache(); const us = UserUtils.getOurPubKeyFromCache();
let isSyncMessage = false; let isSyncMessage = false;
if (us && destinationPk.isEqual(us)) { 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. // or a message with a syncTarget set.
if (MessageSender.isSyncMessage(message)) { if (MessageSender.isSyncMessage(message)) {

@ -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`. * 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. * 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. * 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. * 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. * 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.
* *

@ -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 * 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<string | null> { export async function pickFileForAvatar(): Promise<string | null> {
if (process.env.NODE_APP_INSTANCE?.includes('test-integration')) { if (window.sessionFeatureFlags.integrationTestEnv) {
window.log.info( window.log.info(
'shorting pickFileForAvatar as it does not work in playwright/notsending the filechooser event' 'shorting pickFileForAvatar as it does not work in playwright/notsending the filechooser event'
); );

1
ts/window.d.ts vendored

@ -34,6 +34,7 @@ declare global {
useOnionRequests: boolean; useOnionRequests: boolean;
useTestNet: boolean; useTestNet: boolean;
useClosedGroupV3: boolean; useClosedGroupV3: boolean;
integrationTestEnv: boolean;
debug: { debug: {
debugLogging: boolean; debugLogging: boolean;
debugLibsessionDumps: boolean; debugLibsessionDumps: boolean;

Loading…
Cancel
Save