Force social graph to pull down updates after beta.11 install

This commit is contained in:
Scott Nonnenberg
2020-07-24 16:32:08 -07:00
parent d07b8e82b2
commit bab59ba2a1
13 changed files with 90 additions and 28 deletions

View File

@@ -129,6 +129,7 @@ const dataInterface: ClientInterface = {
updateConversations,
removeConversation,
eraseStorageIdFromConversations,
getAllConversations,
getAllConversationIds,
getAllPrivateConversations,
@@ -770,6 +771,10 @@ async function _removeConversations(ids: Array<string>) {
await channels.removeConversation(ids);
}
async function eraseStorageIdFromConversations() {
await channels.eraseStorageIdFromConversations();
}
async function getAllConversations({
ConversationCollection,
}: {

View File

@@ -67,6 +67,7 @@ export interface DataInterface {
removeAllSessions: () => Promise<void>;
getAllSessions: () => Promise<Array<SessionType>>;
eraseStorageIdFromConversations: () => Promise<void>;
getConversationCount: () => Promise<number>;
saveConversation: (data: ConversationType) => Promise<void>;
saveConversations: (array: Array<ConversationType>) => Promise<void>;

View File

@@ -104,6 +104,7 @@ const dataInterface: ServerInterface = {
updateConversation,
updateConversations,
removeConversation,
eraseStorageIdFromConversations,
getAllConversations,
getAllConversationIds,
getAllPrivateConversations,
@@ -2240,6 +2241,16 @@ async function getConversationById(id: string) {
return jsonToObject(row.json);
}
async function eraseStorageIdFromConversations() {
const db = getInstance();
await db.run(
`UPDATE conversations SET
json = json_remove(json, '$.storageID');
`
);
}
async function getAllConversations() {
const db = getInstance();
const rows = await db.all('SELECT json FROM conversations ORDER BY id ASC;');