Skip to content

fix(3406): Don't fail deletes on canAppend when role name can't be resolved - #3408

Open
islathehut wants to merge 5 commits into
9.0.0from
fix/3406-private-channel-deletions-lock-metadata-db
Open

fix(3406): Don't fail deletes on canAppend when role name can't be resolved#3408
islathehut wants to merge 5 commits into
9.0.0from
fix/3406-private-channel-deletions-lock-metadata-db

Conversation

@islathehut

@islathehut islathehut commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

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

Description

This problem occurred because oplog traversal was shortcircuited by canAppend on the channel metadata access controller returning false. When I added delete permission checks what I didn't take into account is that failure to return true would cause OrbitDB to throw an error while traversing the log and new, validated entries wouldn't get picked up. This means that even if you are added to a new private channel created after the deletion you'd never sync the channel. The relevant code from OrbitDB:

const verifyEntry = async (entry) => {
  // Check that the Entry belongs to this Log
  if (entry.id !== id) {
    throw new Error(`Entry's id (${entry.id}) doesn't match the log's id (${id}).`)
  }
  // Verify if entry is allowed to be added to the log
  const canAppend = await access.canAppend(entry)
  if (!canAppend) {
    throw new Error(`Could not append entry:\nKey "${entry.identity}" is not allowed to write to the log`)
  }
  // Verify signature for the entry
  const isValid = await Entry.verify(identity, entry)
  if (!isValid) {
    throw new Error(`Could not validate signature for entry "${entry.hash}"`)
  }
}

@islathehut islathehut linked an issue Aug 5, 2026 that may be closed by this pull request
@islathehut islathehut changed the title fix(3406): Don't invalidate deletes when role name can't be resolved fix(3406): Don't fail deletes on canAppend when role name can't be resolved Aug 5, 2026
@islathehut
islathehut requested a review from adrastaea August 5, 2026 20:50
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.

Can't add users to the private channel

1 participant