Add Channel Metadata Validation#3323
Merged
islathehut merged 24 commits intoJul 6, 2026
Merged
Conversation
…/channel-metadata-validation-develop
This reverts commit 90322af.
…dates - Introduced channel metadata update handlers to manage updates more effectively. - Added methods to attach and detach channel metadata update handlers. - Improved channel subscription logic to ensure channels are subscribed before sending messages. - Refactored channel subscription checks and added new selectors for subscribed channels. - Implemented a saga to wait for channel subscriptions before proceeding with message sending and initial channel message creation. - Updated tests to cover new subscription logic and ensure proper handling of channel states.
…dd integration test for channels service
…n closing one; add unit test for ChannelStore to ignore updates without matching channel id
adrastaea
marked this pull request as ready for review
July 2, 2026 20:25
Collaborator
|
Made a few small changes (added tests, small refactors, fixes post-merge from develop) and tests are passing locally. The validation logic looks good to me but I'd like Taea's input on my changes before approving/merging. |
Collaborator
|
Wanted to note for future us that these changes aren't backwards compatible. |
islathehut
changed the base branch from
develop
to
featureBranch/private-channels-redux
July 6, 2026 17:45
islathehut
merged commit Jul 6, 2026
df67ab8
into
featureBranch/private-channels-redux
45 of 47 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR hardens channel metadata storage and subscription readiness for public/private channels.
The main change is replacing permissive channel metadata writes with validated, role-aware OrbitDB metadata writes. Public and private channel metadata now live in separate stores, private channel metadata is encrypted to the channel-specific role, and metadata updates are checked against sigchain identity, team membership, owner, role, and privacy invariants.
Key Changes
ChannelMetadataAccessControllerthat validates OrbitDB metadata writers, rejects duplicate metadataPUTs for an existing channel key, and restricts metadataDELs to admins (packages/backend/src/nest/storage/channels/orbitdb/ChannelMetadataAccessController.ts:121).CHANNEL_METADATA_STORE_NAMEandPRIVATE_CHANNEL_METADATA_STORE_NAME(packages/backend/src/nest/storage/channels/channels.service.ts:248,packages/types/src/channel.ts:9).packages/backend/src/nest/storage/channels/channels.service.ts:322).channelName_randomhelper, so clients create channels by name/team/privacy and use the canonical channel returned by the backend (packages/backend/src/nest/storage/channels/channels.service.ts:955,packages/common/src/channelAddress.ts:1).CHANNEL_SUBSCRIBEDafter the store is actually subscribed, state-manager records that status, and message sends wait for the target channel subscription before emitting to the backend (packages/backend/src/nest/storage/channels/channels.service.ts:1031,packages/state-manager/src/sagas/publicChannels/waitForChannelSubscription.saga.ts:8,packages/state-manager/src/sagas/messages/sendMessage/sendMessage.saga.ts:90).packages/desktop/src/renderer/components/Channel/Channel.tsx:25,packages/desktop/src/renderer/components/Channel/ChannelComponent.tsx:267).packages/backend/src/nest/storage/orbitDb/orbitDb.service.ts:64,packages/backend/src/nest/storage/orbitDb/orbitDb.service.ts:299).packages/backend/src/nest/storage/orbitDb/keyValueWithStorage.ts:8,packages/backend/src/nest/storage/orbitDb/keyValueWithStorage.ts:64).Pull Request Checklist
(Optional) Mobile checklist
Please ensure you completed the following checks if you did any changes to the mobile package: