fix(research): re-anchor the export sanitizer after aw-server-rust#677 streaming exports - #1449
Merged
Merged
Conversation
…7 streaming exports Both Research Edition legs fail on master since the v0.14.0 submodule bump (aac77dc) at "Patch research edition export hostname sanitizer": export.rs: expected exactly one export-sanitizer insertion point, found 0 aw-server-rust#677 (perf(export): serialize HTTP exports with bounded event buffering) rewrote the export path: `/api/0/export` and `/api/0/buckets/<id>/export` are now one-line calls to `BucketsExportRocket::new`, which spools the JSON through `aw_datastore::export_to_file`. No whole `BucketsExport` value exists at the endpoints any more, so the old needles in export.rs and bucket.rs are gone. The sanitizer needs the whole export (fail closed on unfiltered events, identity rewriting with collision detection across buckets), so it is now spliced into `BucketsExportRocket::new` instead: re-read the spooled JSON, sanitize, spool again. That is one insertion point for both endpoints, and it relaxes #677's memory bound only for research builds, whose exports are category-only and small. Fails closed as before if the call site drifts. Verified: patcher tests pass; patch applied to aw-server-rust b0fab73 and `cargo check -p aw-server` compiles the inserted code.
Member
Author
|
@greptileai review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Contributor
|
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.
Fixes the two red Research Edition legs on master since the v0.14.0 submodule bump (
aac77dc):Cause
The bump pulled in ActivityWatch/aw-server-rust#677 (bounded-buffer streaming exports). Both export endpoints are now one-line calls to
BucketsExportRocket::new, which spools the JSON viaaw_datastore::export_to_file; no wholeBucketsExportvalue exists at the endpoints any more, so both needles the patcher looked for (export.rs,bucket.rs) are gone. Reproduced locally by running the patcher againstb0fab73.This surfaced at the bump rather than when #677 merged because the research patch is only ever exercised against the bundle's pinned pointer — exactly the gap #1448 (nightly build against submodule masters) closes.
Fix
The sanitizer needs the whole export (fail-closed on unfiltered events; identity rewriting with cross-bucket collision detection), so it is spliced into
BucketsExportRocket::new— the single point both endpoints share: re-read the spooled JSON,sanitize_buckets_export, spool again, rewind. Trade-off stated in the code: this relaxes #677's memory bound only for research builds, whose exports are category-only and small. The patcher no longer touchesexport.rs/bucket.rs, so endpoint churn can't break it again; a missing call site still fails closed.Verified
pytest scripts/tests/test_patch_research_edition_export.py— 7 pass (fixture is now the post-#677util.rs; adds a fail-closed test for a pre-#677 tree).aw-server-rustsubmodule atb0fab73;cargo check -p aw-servercompiles the inserted code. Submodule reverted afterwards.