fix: bump libsession to allow createdAt to be given during migration

pull/2795/head
Audric Ackermann 2 years ago
parent fed58161a0
commit 4280d83ba8

@ -100,7 +100,7 @@
"glob": "7.1.2", "glob": "7.1.2",
"image-type": "^4.1.0", "image-type": "^4.1.0",
"ip2country": "1.0.1", "ip2country": "1.0.1",
"libsession_util_nodejs": "https://github.com/oxen-io/libsession-util-nodejs/releases/download/v0.1.19/libsession_util_nodejs-v0.1.19.tar.gz", "libsession_util_nodejs": "https://github.com/oxen-io/libsession-util-nodejs/releases/download/v0.1.20/libsession_util_nodejs-v0.1.20.tar.gz",
"libsodium-wrappers-sumo": "^0.7.9", "libsodium-wrappers-sumo": "^0.7.9",
"linkify-it": "3.0.2", "linkify-it": "3.0.2",
"lodash": "^4.17.21", "lodash": "^4.17.21",

@ -1235,6 +1235,8 @@ function insertContactIntoContactWrapper(
dbProfileKey: contact.profileKey || undefined, dbProfileKey: contact.profileKey || undefined,
dbProfileUrl: contact.avatarPointer || undefined, dbProfileUrl: contact.avatarPointer || undefined,
priority, priority,
dbCreatedAtSeconds: Math.floor((contact.active_at || Date.now()) / 1000),
// expirationTimerSeconds, // expirationTimerSeconds,
}); });
@ -1259,6 +1261,7 @@ function insertContactIntoContactWrapper(
dbProfileKey: undefined, dbProfileKey: undefined,
dbProfileUrl: undefined, dbProfileUrl: undefined,
priority: CONVERSATION_PRIORITIES.default, priority: CONVERSATION_PRIORITIES.default,
dbCreatedAtSeconds: Math.floor(Date.now() / 1000),
// expirationTimerSeconds: 0, // expirationTimerSeconds: 0,
}) })
); );
@ -1308,7 +1311,7 @@ function insertCommunityIntoWrapper(
const convoId = community.id; // the id of a conversation has the prefix, the serverUrl and the roomToken already present, but not the pubkey const convoId = community.id; // the id of a conversation has the prefix, the serverUrl and the roomToken already present, but not the pubkey
const roomDetails = sqlNode.getV2OpenGroupRoom(convoId, db); const roomDetails = sqlNode.getV2OpenGroupRoom(convoId, db);
hasDebugEnvVariable && console.info('insertCommunityIntoWrapper: ', community); // hasDebugEnvVariable && console.info('insertCommunityIntoWrapper: ', community);
if ( if (
!roomDetails || !roomDetails ||

@ -70,6 +70,7 @@ async function insertContactFromDBIntoWrapperAndRefresh(id: string): Promise<voi
dbProfileKey, dbProfileKey,
dbProfileUrl, dbProfileUrl,
priority, priority,
dbCreatedAtSeconds: 0, // just give 0, now() will be used internally by the wrapper if the contact does not exist yet.
// expirationTimerSeconds, // expirationTimerSeconds,
}); });
try { try {

@ -115,6 +115,7 @@ export function getContactInfoFromDBValues({
priority, priority,
dbProfileUrl, dbProfileUrl,
dbProfileKey, dbProfileKey,
dbCreatedAtSeconds,
}: // expirationTimerSeconds, }: // expirationTimerSeconds,
{ {
id: string; id: string;
@ -124,6 +125,7 @@ export function getContactInfoFromDBValues({
dbNickname: string | undefined; dbNickname: string | undefined;
dbName: string | undefined; dbName: string | undefined;
priority: number; priority: number;
dbCreatedAtSeconds: number;
dbProfileUrl: string | undefined; dbProfileUrl: string | undefined;
dbProfileKey: string | undefined; dbProfileKey: string | undefined;
// expirationTimerSeconds: number | undefined; // expirationTimerSeconds: number | undefined;
@ -136,6 +138,7 @@ export function getContactInfoFromDBValues({
priority, priority,
nickname: dbNickname, nickname: dbNickname,
name: dbName, name: dbName,
createdAtSeconds: dbCreatedAtSeconds,
// expirationTimerSeconds: // expirationTimerSeconds:
// !!expirationTimerSeconds && isFinite(expirationTimerSeconds) && expirationTimerSeconds > 0 // !!expirationTimerSeconds && isFinite(expirationTimerSeconds) && expirationTimerSeconds > 0
// ? expirationTimerSeconds // ? expirationTimerSeconds

@ -5148,9 +5148,9 @@ levn@~0.3.0:
prelude-ls "~1.1.2" prelude-ls "~1.1.2"
type-check "~0.3.2" type-check "~0.3.2"
"libsession_util_nodejs@https://github.com/oxen-io/libsession-util-nodejs/releases/download/v0.1.19/libsession_util_nodejs-v0.1.19.tar.gz": "libsession_util_nodejs@https://github.com/oxen-io/libsession-util-nodejs/releases/download/v0.1.20/libsession_util_nodejs-v0.1.20.tar.gz":
version "0.1.19" version "0.1.20"
resolved "https://github.com/oxen-io/libsession-util-nodejs/releases/download/v0.1.19/libsession_util_nodejs-v0.1.19.tar.gz#294c6e8ea6b767d375a9c0249bef98b65f3ae252" resolved "https://github.com/oxen-io/libsession-util-nodejs/releases/download/v0.1.20/libsession_util_nodejs-v0.1.20.tar.gz#4ff8331e4efb1725cf8bba0ef1af7496ebd8533d"
dependencies: dependencies:
cmake-js "^7.2.1" cmake-js "^7.2.1"
node-addon-api "^6.1.0" node-addon-api "^6.1.0"

Loading…
Cancel
Save