-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Not initializing on reconnection when general channel was deleted (#2334) #2400
Conversation
…s deleted while they were offline
Fixes #2334 |
const allEntries = this.getAllEventLogRawEntries(repo.db) | ||
// const allEntries = this.getAllEventLogRawEntries(repo.db) | ||
await repo.db.close() | ||
await repo.db.drop() | ||
const hashes = allEntries.map(e => CID.parse(e.hash)) | ||
const files = allEntries | ||
.map(e => { | ||
return e.payload.value.media | ||
}) | ||
.filter(isDefined) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes were just to clean up some seemingly useless stuff. We weren't doing anything with those hashes/files so its just wasted work.
// Removing channels from store | ||
if (databaseStoredChannelsIds.length > 0) { | ||
for (const channelId of locallyStoredChannels) { | ||
if (!databaseStoredChannelsIds.includes(channelId)) { | ||
log(`Removing #${channelId} from store`) | ||
yield* put(publicChannelsActions.deleteChannel({ channelId })) | ||
yield* take(publicChannelsActions.completeChannelDeletion) | ||
} | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue ended up being that we were deleting the old general channel before we recreated it with the new ID so the check for the presence of the new channel was happening too early. Swapping the order of operations fixes it.
Pull Request Checklist
(Optional) Mobile checklist
Please ensure you completed the following checks if you did any changes to the mobile package: