Merged
Conversation
- Implemented `redact_json_updates` function to redact sensitive content in JSON updates. - Added tests for `redactJsonUpdates` to ensure sensitive content is properly redacted.
Contributor
There was a problem hiding this comment.
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
Leeeon233
approved these changes
May 19, 2025
Contributor
WASM Size Report
|
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.
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.
redact_json_updatesfunction to redact sensitive content in JSON updates.redactJsonUpdatesto ensure sensitive content is properly redacted.related: #504