Skip to content

Conversation

@codabrink
Copy link
Contributor

@codabrink codabrink commented Dec 6, 2025

Removing events in favor of a log parser.

@claude
Copy link

claude bot commented Dec 6, 2025

Claude finished @codabrink's task —— View job


PR Review - December 8, 2025, 4:06 PM UTC

Todo List:

  • Review core changes in builder.rs and context.rs
  • Review database migration
  • Check the uncovered line in export_stream
  • Review bindings API changes
  • Review deleted event utilities
  • Provide final feedback

Review Summary

This PR successfully removes the event tracking subsystem in favor of log parsing. The changes are clean and comprehensive. Here are my findings:

✅ Positives

  1. Clean removal - All event-related code has been systematically removed across the codebase
  2. Database migration - Proper up/down migrations provided for the events table drop
  3. API simplification - Removed disable_events parameter from all binding APIs (FFI, Node, WASM)
  4. Breaking change - Appropriately deprecates the event_backup proto field

🔍 Issues Found

1. Uncovered line in export_stream (xmtp_archive/src/export_stream/mod.rs:54)

The Codecov report flags line 54 as uncovered:

BackupElementSelection::Event => vec![],  // Line 54

Impact: Low - This is a dead code path since Event backups now return empty vec. However, it's being evaluated in the match statement.

Recommendation: Consider removing the Event variant from BackupElementSelection enum entirely in a follow-up PR, or add a comment explaining this is deprecated but kept for backwards compatibility.

2. Proto deprecation without removal

The event_backup field is marked as deprecated in the proto definitions (commit 897b1dc), but the BackupElementSelection::Event enum variant still exists.

Recommendation: If you're maintaining backwards compatibility, add a code comment in xmtp_archive/src/export_stream/mod.rs:54 explaining that this variant is kept for proto compatibility but returns no data.

📋 Minor Observations

  1. Proto file reformatting - The proto changes show extensive line-by-line diffs that appear to be formatting-only changes (no functional changes to xmtp.message_api.v1.rs, xmtp.message_contents.rs, etc.). This makes the diff harder to review but doesn't affect functionality.

  2. Test coverage - The PR removes test files like test_key_updates.rs. Ensure the functionality previously tested there is covered elsewhere if still relevant.

  3. Consistent cleanup - Good job removing event-related code from:

    • ClientBuilder (removed 73 lines including with_disable_events method)
    • XmtpMlsLocalContext (cleaned up broadcast channels that were event-specific)
    • All bindings (FFI, Node, WASM) updated consistently

🎯 Recommendations

  1. Add test coverage for the BackupElementSelection::Event path to satisfy Codecov, or explicitly document why it's excluded
  2. Follow-up PR: Consider fully removing the Event backup element selection in a future PR once proto backward compatibility is no longer needed
  3. Migration testing: Ensure the database migration has been tested with existing databases that have event data

Security & Performance

  • ✅ No security concerns identified
  • ✅ Performance should improve by removing event tracking overhead
  • ✅ No sensitive data exposure issues

Code Quality

  • ✅ Code follows Rust best practices
  • ✅ No clippy warnings introduced
  • ✅ Consistent API changes across all bindings

Overall Assessment: This is a well-executed removal of a major subsystem. The only concern is the uncovered line and potential confusion around the deprecated Event backup selection. These are minor issues that don't block the PR.


@macroscopeapp
Copy link
Contributor

macroscopeapp bot commented Dec 6, 2025

Remove the events subsystem and drop the events database table across xmtp_mls builders, contexts, bindings, and migrations

Remove event tracking, broadcasting, and upload paths from builders, contexts, groups, and tests; delete disable_events from public APIs in FFI/Node/WASM; remove event exports in archive; drop the events table via a new migration; and update generated proto files with reordering only.

📍Where to Start

Start with event removal in the builder and context flow: ClientBuilder::build in builder.rs and the XmtpMlsLocalContext and XmtpSharedContext changes in context.rs.


Macroscope summarized aadf73c.

@codecov
Copy link

codecov bot commented Dec 6, 2025

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 73.87%. Comparing base (8faf55f) to head (aadf73c).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
xmtp_archive/src/export_stream/mod.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2907      +/-   ##
==========================================
- Coverage   73.98%   73.87%   -0.11%     
==========================================
  Files         393      390       -3     
  Lines       50363    49996     -367     
==========================================
- Hits        37260    36934     -326     
+ Misses      13103    13062      -41     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codabrink codabrink marked this pull request as ready for review December 8, 2025 15:48
@codabrink codabrink requested a review from a team as a code owner December 8, 2025 15:48
@codabrink codabrink merged commit f0e7700 into main Dec 8, 2025
23 checks passed
@codabrink codabrink deleted the coda/remove-events branch December 8, 2025 20:22
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