Skip to content

feat: add redact to wasm#729

Merged
zxch3n merged 8 commits intomainfrom
feat-redact-wasm
May 19, 2025
Merged

feat: add redact to wasm#729
zxch3n merged 8 commits intomainfrom
feat-redact-wasm

Conversation

@zxch3n
Copy link
Copy Markdown
Member

@zxch3n zxch3n commented May 19, 2025

  • Implemented redact_json_updates function to redact sensitive content in JSON updates.
  • Added tests for redactJsonUpdates to ensure sensitive content is properly redacted.

related: #504

zxch3n added 2 commits May 19, 2025 11:38
- Implemented `redact_json_updates` function to redact sensitive content in JSON updates.
- Added tests for `redactJsonUpdates` to ensure sensitive content is properly redacted.
@zxch3n zxch3n requested review from Leeeon233 and Copilot May 19, 2025 04:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds functionality to redact sensitive content in JSON updates for the wasm module and includes comprehensive tests to verify correct redaction behavior.

  • Adds the redact_json_updates function in Rust to handle JSON redaction and its corresponding JS wrapper.
  • Updates tests in TypeScript to validate that sensitive content is properly replaced.
  • Makes changes to JSON schema conversion functions to support the new redaction logic.

Reviewed Changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
crates/loro-wasm/tests/basic.test.ts Added tests to verify removal of sensitive information.
crates/loro-wasm/src/lib.rs Updated JSON schema conversion and import_json_updates logic.
crates/loro-wasm/src/convert.rs Introduced functions for converting between JSON schema types.
crates/loro-wasm/scripts/build.ts Integrated brotli compression alongside gzip.
crates/loro-wasm/package.json Added the brotli-wasm dependency.
crates/loro-internal/src/state/counter_state.rs Removed #[must_use] for apply_diff_and_convert.
crates/loro-internal/src/oplog/change_store.rs Allowed clippy warning for result_large_err.
crates/loro-internal/src/container/richtext/tracker.rs Removed #[must_use] on skip_applied.
crates/loro-internal/Cargo.toml Updated target dependency config for wasm environment.
crates/loro-ffi/src/doc.rs Added a wrapper for redact_json_updates with JSON serialization.
.changeset/grumpy-chicken-beam.md Documented the redact feature change.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Comment thread crates/loro-ffi/src/doc.rs
Comment thread crates/loro-wasm/src/convert.rs
@github-actions
Copy link
Copy Markdown
Contributor

WASM Size Report

  • Original size: 3032.14 KB
  • Gzipped size: 958.95 KB
  • Brotli size: 666.20 KB

@zxch3n zxch3n merged commit 60876bb into main May 19, 2025
1 check passed
@zxch3n zxch3n deleted the feat-redact-wasm branch May 19, 2025 08:14
zxch3n added a commit to synoet/loro that referenced this pull request May 20, 2025
* feat: add redact to wasm

- Implemented `redact_json_updates` function to redact sensitive content in JSON updates.
- Added tests for `redactJsonUpdates` to ensure sensitive content is properly redacted.
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.

3 participants