fix: sync workspace properties via op log + read-only gate#199
Open
careck wants to merge 3 commits into
Open
Conversation
…owners Workspace metadata changes (author, license, description, etc.) were written directly to workspace_meta without creating an Operation, so they never propagated to peers. Non-owners could also edit the form (only to get an error on save). - Add UpdateWorkspaceMetadata operation variant with signed op logging - Apply incoming metadata ops in apply_incoming_operation (owner-gated) - Include workspace_metadata in WorkspaceSnapshot for initial peer sync - Gate WorkspacePropertiesDialog as read-only for non-owners with hint
… gate - cargo fmt on menu.rs after merge with development - Add UpdateWorkspaceMetadata to rbac gate resolve_scope (workspace-level, no note scope)
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.
Summary
set_workspace_metadatacreates a signedUpdateWorkspaceMetadataoperation in the op log, so changes propagate via delta bundlesWorkspacePropertiesDialogfetchesis_workspace_ownerand disables all inputs with a yellow hint banner when not owner; only a Close button is shown (no Save)WorkspaceSnapshotnow carriesworkspace_metadataso peers joining later also receive itWhat changed
Rust core (krillnotes-core)
Operation::UpdateWorkspaceMetadatavariant added with all match arms (operation_id, timestamp, device_id, metadata_json, modified_by, signature)set_workspace_metadata()now wraps the write in a transaction, creates + signs the operation, and logs itapply_incoming_operation()handles the new variant (owner-gated, same pattern as script ops)WorkspaceSnapshotincludes optionalworkspace_metadatafieldto_snapshot_json()/import_snapshot_json()serialize/deserialize workspace metadataFrontend (krillnotes-desktop)
WorkspacePropertiesDialogfetches ownership state and renders read-only for non-ownersworkspace.propertiesReadOnlyadded to all 7 localesTest plan
cargo test -p krillnotes-core— 674 tests passcargo clippy -p krillnotes-core -- -D warnings— cleancargo fmt --check— cleannpx tsc --noEmit— clean