Skip to content
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

Merged
merged 3 commits into from
Apr 4, 2024

Conversation

islathehut
Copy link
Collaborator

@islathehut islathehut commented Apr 2, 2024

Pull Request Checklist

  • I have linked this PR to a related GitHub issue.
  • I have added a description of the change (and Github issue number, if any) to the root CHANGELOG.md.

(Optional) Mobile checklist

Please ensure you completed the following checks if you did any changes to the mobile package:

  • I have run e2e tests for mobile
  • I have updated base screenshots for visual regression tests

@islathehut
Copy link
Collaborator Author

Fixes #2334

Comment on lines -614 to -622
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)
Copy link
Collaborator Author

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.

Comment on lines -27 to -37
// 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)
}
}
}

Copy link
Collaborator Author

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.

@islathehut islathehut changed the base branch from develop to 2.2.0 April 4, 2024 15:56
@islathehut islathehut merged commit bc34b16 into 2.2.0 Apr 4, 2024
19 of 21 checks passed
@islathehut islathehut deleted the fix-2334-recreated-channel-not-visible branch April 4, 2024 15:57
leblowl pushed a commit that referenced this pull request Apr 4, 2024
#2334) (#2400)

* Fix issue with users joining a community where the general channel was deleted while they were offline

* Update e2e tests to include case for this bug

* Update CHANGELOG.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants