fix: disable expire timer tracking for all libsession logic
this will need to be turned on when the disappearing branch is merged
This commit is contained in:
parent
bec667ebee
commit
0e18bf4640
|
@ -100,7 +100,7 @@
|
|||
"glob": "7.1.2",
|
||||
"image-type": "^4.1.0",
|
||||
"ip2country": "1.0.1",
|
||||
"libsession_util_nodejs": "https://github.com/oxen-io/libsession-util-nodejs/releases/download/v0.1.18/libsession_util_nodejs-v0.1.18.tar.gz",
|
||||
"libsession_util_nodejs": "https://github.com/oxen-io/libsession-util-nodejs/releases/download/v0.1.19/libsession_util_nodejs-v0.1.19.tar.gz",
|
||||
"libsodium-wrappers-sumo": "^0.7.9",
|
||||
"linkify-it": "3.0.2",
|
||||
"lodash": "^4.17.21",
|
||||
|
|
|
@ -1223,7 +1223,7 @@ function insertContactIntoContactWrapper(
|
|||
const dbApprovedMe = !!contact.didApproveMe || false;
|
||||
const dbBlocked = blockedNumbers.includes(contact.id);
|
||||
const priority = contact.priority || CONVERSATION_PRIORITIES.default;
|
||||
const expirationTimerSeconds = contact.expireTimer || 0;
|
||||
// const expirationTimerSeconds = contact.expireTimer || 0;
|
||||
|
||||
const wrapperContact = getContactInfoFromDBValues({
|
||||
id: contact.id,
|
||||
|
@ -1235,7 +1235,7 @@ function insertContactIntoContactWrapper(
|
|||
dbProfileKey: contact.profileKey || undefined,
|
||||
dbProfileUrl: contact.avatarPointer || undefined,
|
||||
priority,
|
||||
expirationTimerSeconds,
|
||||
// expirationTimerSeconds,
|
||||
});
|
||||
|
||||
try {
|
||||
|
@ -1259,7 +1259,7 @@ function insertContactIntoContactWrapper(
|
|||
dbProfileKey: undefined,
|
||||
dbProfileUrl: undefined,
|
||||
priority: CONVERSATION_PRIORITIES.default,
|
||||
expirationTimerSeconds: 0,
|
||||
// expirationTimerSeconds: 0,
|
||||
})
|
||||
);
|
||||
} catch (e) {
|
||||
|
@ -1373,7 +1373,7 @@ function insertCommunityIntoWrapper(
|
|||
function insertLegacyGroupIntoWrapper(
|
||||
legacyGroup: Pick<
|
||||
ConversationAttributes,
|
||||
'id' | 'priority' | 'expireTimer' | 'displayNameInProfile' | 'lastJoinedTimestamp'
|
||||
'id' | 'priority' | 'displayNameInProfile' | 'lastJoinedTimestamp' // | 'expireTimer'
|
||||
> & { members: string; groupAdmins: string }, // members and groupAdmins are still stringified here
|
||||
userGroupConfigWrapper: UserGroupsWrapperNode,
|
||||
volatileInfoConfigWrapper: ConvoInfoVolatileWrapperNode,
|
||||
|
@ -1382,7 +1382,7 @@ function insertLegacyGroupIntoWrapper(
|
|||
const {
|
||||
priority,
|
||||
id,
|
||||
expireTimer,
|
||||
// expireTimer,
|
||||
groupAdmins,
|
||||
members,
|
||||
displayNameInProfile,
|
||||
|
@ -1397,7 +1397,7 @@ function insertLegacyGroupIntoWrapper(
|
|||
const wrapperLegacyGroup = getLegacyGroupInfoFromDBValues({
|
||||
id,
|
||||
priority,
|
||||
expireTimer,
|
||||
// expireTimer,
|
||||
groupAdmins,
|
||||
members,
|
||||
displayNameInProfile,
|
||||
|
@ -1625,7 +1625,7 @@ function updateToSessionSchemaVersion31(currentVersion: number, db: BetterSqlite
|
|||
const ourDbProfileUrl = ourConversation.avatarPointer || '';
|
||||
const ourDbProfileKey = fromHexToArray(ourConversation.profileKey || '');
|
||||
const ourConvoPriority = ourConversation.priority;
|
||||
const ourConvoExpire = ourConversation.expireTimer || 0;
|
||||
// const ourConvoExpire = ourConversation.expireTimer || 0;
|
||||
if (ourDbProfileUrl && !isEmpty(ourDbProfileKey)) {
|
||||
userProfileWrapper.setUserInfo(
|
||||
ourDbName,
|
||||
|
@ -1634,7 +1634,7 @@ function updateToSessionSchemaVersion31(currentVersion: number, db: BetterSqlite
|
|||
url: ourDbProfileUrl,
|
||||
key: ourDbProfileKey,
|
||||
},
|
||||
ourConvoExpire
|
||||
// ourConvoExpire
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -330,10 +330,10 @@ async function handleContactsUpdate(result: IncomingConfResult): Promise<Incomin
|
|||
changes = true;
|
||||
}
|
||||
|
||||
if (wrapperConvo.expirationTimerSeconds !== contactConvo.get('expireTimer')) {
|
||||
await contactConvo.updateExpireTimer(wrapperConvo.expirationTimerSeconds);
|
||||
changes = true;
|
||||
}
|
||||
// if (wrapperConvo.expirationTimerSeconds !== contactConvo.get('expireTimer')) {
|
||||
// await contactConvo.updateExpireTimer(wrapperConvo.expirationTimerSeconds);
|
||||
// changes = true;
|
||||
// }
|
||||
|
||||
// we want to set the active_at to the created_at timestamp if active_at is unset, so that it shows up in our list.
|
||||
if (!contactConvo.get('active_at') && wrapperConvo.createdAtSeconds) {
|
||||
|
@ -558,17 +558,17 @@ async function handleLegacyGroupUpdate(latestEnvelopeTimestamp: number) {
|
|||
changes = true;
|
||||
}
|
||||
|
||||
if (legacyGroupConvo.get('expireTimer') !== fromWrapper.disappearingTimerSeconds) {
|
||||
await legacyGroupConvo.updateExpireTimer(
|
||||
fromWrapper.disappearingTimerSeconds,
|
||||
undefined,
|
||||
latestEnvelopeTimestamp,
|
||||
{
|
||||
fromSync: true,
|
||||
}
|
||||
);
|
||||
changes = true;
|
||||
}
|
||||
// if (legacyGroupConvo.get('expireTimer') !== fromWrapper.disappearingTimerSeconds) {
|
||||
// await legacyGroupConvo.updateExpireTimer(
|
||||
// fromWrapper.disappearingTimerSeconds,
|
||||
// undefined,
|
||||
// latestEnvelopeTimestamp,
|
||||
// {
|
||||
// fromSync: true,
|
||||
// }
|
||||
// );
|
||||
// changes = true;
|
||||
// }
|
||||
// start polling for this group if we haven't left it yet. The wrapper does not store this info for legacy group so we check from the DB entry instead
|
||||
if (!legacyGroupConvo.get('isKickedFromGroup') && !legacyGroupConvo.get('left')) {
|
||||
getSwarmPollingInstance().addGroupId(PubKey.cast(fromWrapper.pubkeyHex));
|
||||
|
|
|
@ -57,7 +57,8 @@ async function insertContactFromDBIntoWrapperAndRefresh(id: string): Promise<voi
|
|||
const dbApprovedMe = !!foundConvo.get('didApproveMe') || false;
|
||||
const dbBlocked = !!foundConvo.isBlocked() || false;
|
||||
const priority = foundConvo.get('priority') || 0;
|
||||
const expirationTimerSeconds = foundConvo.get('expireTimer') || 0;
|
||||
// expiration timer is not tracked currently but will be once disappearing message is merged into userconfig
|
||||
// const expirationTimerSeconds = foundConvo.get('expireTimer') || 0;
|
||||
|
||||
const wrapperContact = getContactInfoFromDBValues({
|
||||
id,
|
||||
|
@ -69,7 +70,7 @@ async function insertContactFromDBIntoWrapperAndRefresh(id: string): Promise<voi
|
|||
dbProfileKey,
|
||||
dbProfileUrl,
|
||||
priority,
|
||||
expirationTimerSeconds,
|
||||
// expirationTimerSeconds,
|
||||
});
|
||||
try {
|
||||
window.log.debug('inserting into contact wrapper: ', JSON.stringify(wrapperContact));
|
||||
|
|
|
@ -113,7 +113,7 @@ async function insertGroupsFromDBIntoWrapperAndRefresh(convoId: string): Promise
|
|||
priority: foundConvo.get('priority'),
|
||||
members: foundConvo.get('members') || [],
|
||||
groupAdmins: foundConvo.get('groupAdmins') || [],
|
||||
expireTimer: foundConvo.get('expireTimer'),
|
||||
// expireTimer: foundConvo.get('expireTimer'),
|
||||
displayNameInProfile: foundConvo.get('displayNameInProfile'),
|
||||
encPubkeyHex: encryptionKeyPair?.publicHex || '',
|
||||
encSeckeyHex: encryptionKeyPair?.privateHex || '',
|
||||
|
|
|
@ -26,7 +26,7 @@ async function insertUserProfileIntoWrapper(convoId: string) {
|
|||
{ url: dbProfileUrl, key: dbProfileKey }
|
||||
)} `
|
||||
);
|
||||
const expirySeconds = ourConvo.get('expireTimer') || 0;
|
||||
// const expirySeconds = ourConvo.get('expireTimer') || 0;
|
||||
if (dbProfileUrl && !isEmpty(dbProfileKey)) {
|
||||
await UserConfigWrapperActions.setUserInfo(
|
||||
dbName,
|
||||
|
@ -34,11 +34,11 @@ async function insertUserProfileIntoWrapper(convoId: string) {
|
|||
{
|
||||
url: dbProfileUrl,
|
||||
key: dbProfileKey,
|
||||
},
|
||||
expirySeconds
|
||||
}
|
||||
// expirySeconds
|
||||
);
|
||||
} else {
|
||||
await UserConfigWrapperActions.setUserInfo(dbName, priority, null, expirySeconds);
|
||||
await UserConfigWrapperActions.setUserInfo(dbName, priority, null); // expirySeconds
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -115,8 +115,8 @@ export function getContactInfoFromDBValues({
|
|||
priority,
|
||||
dbProfileUrl,
|
||||
dbProfileKey,
|
||||
expirationTimerSeconds,
|
||||
}: {
|
||||
}: // expirationTimerSeconds,
|
||||
{
|
||||
id: string;
|
||||
dbApproved: boolean;
|
||||
dbApprovedMe: boolean;
|
||||
|
@ -126,7 +126,7 @@ export function getContactInfoFromDBValues({
|
|||
priority: number;
|
||||
dbProfileUrl: string | undefined;
|
||||
dbProfileKey: string | undefined;
|
||||
expirationTimerSeconds: number | undefined;
|
||||
// expirationTimerSeconds: number | undefined;
|
||||
}): ContactInfoSet {
|
||||
const wrapperContact: ContactInfoSet = {
|
||||
id,
|
||||
|
@ -136,14 +136,14 @@ export function getContactInfoFromDBValues({
|
|||
priority,
|
||||
nickname: dbNickname,
|
||||
name: dbName,
|
||||
expirationTimerSeconds:
|
||||
!!expirationTimerSeconds && isFinite(expirationTimerSeconds) && expirationTimerSeconds > 0
|
||||
? expirationTimerSeconds
|
||||
: 0, // TODOLATER add the expiration mode handling
|
||||
expirationMode:
|
||||
!!expirationTimerSeconds && isFinite(expirationTimerSeconds) && expirationTimerSeconds > 0
|
||||
? 'disappearAfterSend'
|
||||
: 'off',
|
||||
// expirationTimerSeconds:
|
||||
// !!expirationTimerSeconds && isFinite(expirationTimerSeconds) && expirationTimerSeconds > 0
|
||||
// ? expirationTimerSeconds
|
||||
// : 0, // TODOLATER add the expiration mode handling
|
||||
// expirationMode:
|
||||
// !!expirationTimerSeconds && isFinite(expirationTimerSeconds) && expirationTimerSeconds > 0
|
||||
// ? 'disappearAfterSend'
|
||||
// : 'off',
|
||||
};
|
||||
|
||||
if (
|
||||
|
@ -199,14 +199,14 @@ export function getLegacyGroupInfoFromDBValues({
|
|||
priority,
|
||||
members: maybeMembers,
|
||||
displayNameInProfile,
|
||||
expireTimer,
|
||||
// expireTimer,
|
||||
encPubkeyHex,
|
||||
encSeckeyHex,
|
||||
groupAdmins: maybeAdmins,
|
||||
lastJoinedTimestamp,
|
||||
}: Pick<
|
||||
ConversationAttributes,
|
||||
'id' | 'priority' | 'displayNameInProfile' | 'expireTimer' | 'lastJoinedTimestamp'
|
||||
'id' | 'priority' | 'displayNameInProfile' | 'lastJoinedTimestamp' //| 'expireTimer'
|
||||
> & {
|
||||
encPubkeyHex: string;
|
||||
encSeckeyHex: string;
|
||||
|
@ -224,7 +224,7 @@ export function getLegacyGroupInfoFromDBValues({
|
|||
});
|
||||
const legacyGroup: LegacyGroupInfo = {
|
||||
pubkeyHex: id,
|
||||
disappearingTimerSeconds: !expireTimer ? 0 : expireTimer,
|
||||
// disappearingTimerSeconds: !expireTimer ? 0 : expireTimer,
|
||||
name: displayNameInProfile || '',
|
||||
priority: priority || 0,
|
||||
members: wrappedMembers,
|
||||
|
|
|
@ -104,8 +104,8 @@ export const UserConfigWrapperActions: UserConfigWrapperActionsCalls = {
|
|||
setUserInfo: async (
|
||||
name: string,
|
||||
priority: number,
|
||||
profilePic: { url: string; key: Uint8Array } | null,
|
||||
expireSeconds: number
|
||||
profilePic: { url: string; key: Uint8Array } | null
|
||||
// expireSeconds: number
|
||||
) =>
|
||||
callLibSessionWorker([
|
||||
'UserConfig',
|
||||
|
@ -113,7 +113,7 @@ export const UserConfigWrapperActions: UserConfigWrapperActionsCalls = {
|
|||
name,
|
||||
priority,
|
||||
profilePic,
|
||||
expireSeconds,
|
||||
// expireSeconds,
|
||||
]) as Promise<ReturnType<UserConfigWrapperActionsCalls['setUserInfo']>>,
|
||||
};
|
||||
|
||||
|
|
|
@ -5148,9 +5148,9 @@ levn@~0.3.0:
|
|||
prelude-ls "~1.1.2"
|
||||
type-check "~0.3.2"
|
||||
|
||||
"libsession_util_nodejs@https://github.com/oxen-io/libsession-util-nodejs/releases/download/v0.1.18/libsession_util_nodejs-v0.1.18.tar.gz":
|
||||
version "0.1.18"
|
||||
resolved "https://github.com/oxen-io/libsession-util-nodejs/releases/download/v0.1.18/libsession_util_nodejs-v0.1.18.tar.gz#2580c8b4d6c58da4c22108f88e13dd0cb2da54dc"
|
||||
"libsession_util_nodejs@https://github.com/oxen-io/libsession-util-nodejs/releases/download/v0.1.19/libsession_util_nodejs-v0.1.19.tar.gz":
|
||||
version "0.1.19"
|
||||
resolved "https://github.com/oxen-io/libsession-util-nodejs/releases/download/v0.1.19/libsession_util_nodejs-v0.1.19.tar.gz#294c6e8ea6b767d375a9c0249bef98b65f3ae252"
|
||||
dependencies:
|
||||
cmake-js "^7.2.1"
|
||||
node-addon-api "^6.1.0"
|
||||
|
|
Loading…
Reference in New Issue