// TODO make sure that this works well on windows and macOS builds
// this was tested on windows, linux and macOS builds through the CI and works fine, but might require to make git available in the PATH when building unofficial builds.
// this is used to udpate the hash of the commit in the UI at the bottom of the settings screen, and in the about view
// In the migration 30, we made all the changes which didn't require the user to be logged in yet.
// in this one, we check if a user is logged in, and if yes we build and save the config dumps for the current state of the database.
try{
try{
constkeys=getIdentityKeys(db);
constkeys=getIdentityKeys(db);
@ -1611,7 +1648,7 @@ function updateToSessionSchemaVersion30(currentVersion: number, db: BetterSqlite
// this filter is based on the `isContactToStoreInWrapper` function. Note, blocked contacts won't be added to the wrapper at first, but will on the first start
// this filter is based on the `isContactToStoreInWrapper` function. Note, blocked contacts won't be added to the wrapper at first, but will on the first start
constcontactsToWriteInWrapper=db
constcontactsToWriteInWrapper=db
.prepare(
.prepare(
`SELECT * FROM ${CONVERSATIONS_TABLE} WHERE type = 'private' AND active_at > 0 AND NOT hidden AND (didApproveMe OR isApproved) AND id <> '$us' AND id NOT LIKE '15%' ;`
`SELECT * FROM ${CONVERSATIONS_TABLE} WHERE type = 'private' AND active_at > 0 AND priority <> ${CONVERSATION_PRIORITIES.hidden} AND (didApproveMe OR isApproved) AND id <> '$us' AND id NOT LIKE '15%' ;`
)
)
.all({
.all({
us: publicKeyHex,
us: publicKeyHex,
@ -1762,17 +1799,18 @@ function updateToSessionSchemaVersion30(currentVersion: number, db: BetterSqlite
// we've just created the initial dumps. A ConfSyncJob is run when the app starts after 20 seconds
// we've just created the initial dumps. A ConfSyncJob is run when the app starts after 20 seconds
}catch(e){
}catch(e){
console.error(`failed to create initial wrapper: `,e.stack);
console.error(
`failed to create initial wrapper. Might just not have a logged in user yet? `,
e.message,
e.stack,
e
);
// if we get an exception here, most likely no users are logged in yet. We can just continue the transaction and the wrappers will be created when a user creates a new account.
// if we get an exception here, most likely no users are logged in yet. We can just continue the transaction and the wrappers will be created when a user creates a new account.
}
}
// for manually flagging conversations as :unread"