Skip to content

Conversation

@sampaiodiego
Copy link
Member

@sampaiodiego sampaiodiego commented Sep 24, 2025

Proposed changes (including videos or screenshots)

Issue(s)

Steps to test or reproduce

Further comments

Summary by CodeRabbit

  • Chores

    • Removed legacy Federation features and APIs, including user search, uploads, event dispatch, and DNS endpoints.
    • Disabled Federation in the app: external/federation tab in Directory is no longer accessible; federation-related cron jobs and startup tasks removed.
    • Federation metrics removed from workspace statistics.
  • Documentation

    • Deleted obsolete Federation README and related references.
  • Refactor

    • Cleaned up Federation-related helpers, hooks, normalizers, and configuration to reduce surface area and side effects across the server.

@sampaiodiego sampaiodiego requested review from a team as code owners September 24, 2025 22:30
@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Sep 24, 2025

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link

changeset-bot bot commented Sep 24, 2025

⚠️ No Changeset found

Latest commit: 3971e13

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 24, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This PR removes legacy federation and DNS-related functionality across server, startup, methods, hooks, libs, endpoints, typings, UI, and statistics. It deletes federation APIs, handlers, helpers, cron, configuration, and associated imports; disables federation UI paths; and drops DNS v1 endpoints and their typings.

Changes

Cohort / File(s) Summary
DNS API removal
apps/meteor/app/api/server/index.ts, apps/meteor/app/api/server/v1/dns.ts, packages/rest-typings/src/index.ts, packages/rest-typings/src/v1/dns.ts
Removed DNS v1 endpoints (srv/txt), their registration, and public typings/validators; pruned server import.
Federation endpoints
apps/meteor/app/federation/server/endpoints/index.ts, .../endpoints/dispatch.js, .../endpoints/requestFromLatest.js, .../endpoints/uploads.js, .../endpoints/users.js
Deleted federation REST endpoints including events dispatch, request-from-latest, uploads, and user search/get-by-username; removed index side-effect imports.
Federation hooks
apps/meteor/app/federation/server/hooks/*
Removed all federation lifecycle hooks: room create/delete/add/remove/mute/unmute/leave, message save/delete, set/unset reaction, and their exported definitions.
Federation functions/helpers
apps/meteor/app/federation/server/functions/addUser.js, .../functions/dashboard.js, .../functions/errors.js, .../functions/helpers.ts, .../functions/resolveDNS.ts
Deleted user creation, dashboard stats, error helpers, federation helpers, and DNS resolve utilities.
Federation handlers (client-to-peer)
apps/meteor/app/federation/server/handler/index.ts
Removed exported handlers: user search, get user by username, request/dispatch events, and get upload.
Federation library
apps/meteor/app/federation/server/lib/*
Deleted callbacks management, context resolver, crypt helpers, DNS peer discovery/hub registration, discovery method/domain getters, HTTP helpers, enabled flag, and logger.
Federation methods
apps/meteor/app/federation/server/methods/index.ts, .../methods/dashboard.ts, .../methods/loadContextEvents.ts, .../methods/testSetup.ts
Removed federation DDP methods and index side-effects: dashboard data, load context events, and test setup.
Federation normalizers
apps/meteor/app/federation/server/normalizers/*
Deleted message, room, subscription, and user normalizers and their aggregator.
Federation startup/config
apps/meteor/app/federation/server/index.ts, .../startup/index.ts, .../startup/generateKeys.js, .../startup/registerCallbacks.js, apps/meteor/server/configuration/federation.ts, apps/meteor/server/configuration/index.ts
Removed federation package import/initialization, key generation, callback registration, and server configuration wiring.
Federation cron
apps/meteor/server/cron/federation.ts, apps/meteor/server/startup/cron.ts
Deleted federation cron job module and its startup invocation.
Server imports
apps/meteor/server/importPackages.ts
Removed import of federation server package.
Server methods adjustments
apps/meteor/server/methods/browseChannels.ts, apps/meteor/server/methods/createDirectMessage.ts
Stripped federation lookups/creation paths; removed federation-based user merging and domain parameters.
Statistics/UI
apps/meteor/app/statistics/server/lib/statistics.ts, apps/meteor/client/views/directory/DirectoryPage.tsx
Removed federation stats collection; hardcoded federationEnabled to false in DirectoryPage, disabling external tab.
Docs/constants
apps/meteor/app/federation/README.md, apps/meteor/app/federation/server/constants.ts
Deleted federation README and exported status label constants.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant Peer as External Peer
    participant API as Server REST API
    participant Crypt as Crypt Layer
    participant Proc as Event Processor
    participant DB as DB

    %% Previous (now removed) flow
    Peer->>API: POST /v1/federation.events.dispatch (encrypted payload)
    API->>Crypt: decryptIfNeeded()
    Crypt-->>API: events[]
    API->>Proc: iterate events, per-type handling
    Proc->>DB: persist events, update rooms/users/messages
    Proc-->>API: results
    API-->>Peer: 200 { success: true }

    note over API,Proc: Entire endpoint and processing pipeline removed.
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested labels

stat: ready to merge, stat: QA assured

Suggested reviewers

  • ggazzo
  • rodrigok
  • ricardogarim

Poem

A whisk of ears, a hop, delete—
Old routes retire, their clocks complete.
No keys to forge, no SRV to seek,
The burrow’s quiet, tidy, sleek.
I thump hello to simpler lands—
Less wire, more warren, fewer strands. 🐇✨

✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch remove-leftover-old-federation

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 0b894f7 and 3971e13.

📒 Files selected for processing (60)
  • apps/meteor/app/api/server/index.ts (0 hunks)
  • apps/meteor/app/api/server/v1/dns.ts (0 hunks)
  • apps/meteor/app/federation/README.md (0 hunks)
  • apps/meteor/app/federation/server/constants.ts (0 hunks)
  • apps/meteor/app/federation/server/endpoints/dispatch.js (0 hunks)
  • apps/meteor/app/federation/server/endpoints/index.ts (0 hunks)
  • apps/meteor/app/federation/server/endpoints/requestFromLatest.js (0 hunks)
  • apps/meteor/app/federation/server/endpoints/uploads.js (0 hunks)
  • apps/meteor/app/federation/server/endpoints/users.js (0 hunks)
  • apps/meteor/app/federation/server/functions/addUser.js (0 hunks)
  • apps/meteor/app/federation/server/functions/dashboard.js (0 hunks)
  • apps/meteor/app/federation/server/functions/errors.js (0 hunks)
  • apps/meteor/app/federation/server/functions/helpers.ts (0 hunks)
  • apps/meteor/app/federation/server/functions/resolveDNS.ts (0 hunks)
  • apps/meteor/app/federation/server/handler/index.ts (0 hunks)
  • apps/meteor/app/federation/server/hooks/afterAddedToRoom.js (0 hunks)
  • apps/meteor/app/federation/server/hooks/afterCreateDirectRoom.js (0 hunks)
  • apps/meteor/app/federation/server/hooks/afterCreateRoom.js (0 hunks)
  • apps/meteor/app/federation/server/hooks/afterDeleteMessage.js (0 hunks)
  • apps/meteor/app/federation/server/hooks/afterLeaveRoom.js (0 hunks)
  • apps/meteor/app/federation/server/hooks/afterMuteUser.js (0 hunks)
  • apps/meteor/app/federation/server/hooks/afterRemoveFromRoom.js (0 hunks)
  • apps/meteor/app/federation/server/hooks/afterSaveMessage.js (0 hunks)
  • apps/meteor/app/federation/server/hooks/afterSetReaction.js (0 hunks)
  • apps/meteor/app/federation/server/hooks/afterUnmuteUser.js (0 hunks)
  • apps/meteor/app/federation/server/hooks/afterUnsetReaction.js (0 hunks)
  • apps/meteor/app/federation/server/hooks/beforeDeleteRoom.js (0 hunks)
  • apps/meteor/app/federation/server/index.ts (0 hunks)
  • apps/meteor/app/federation/server/lib/callbacks.ts (0 hunks)
  • apps/meteor/app/federation/server/lib/context.ts (0 hunks)
  • apps/meteor/app/federation/server/lib/crypt.js (0 hunks)
  • apps/meteor/app/federation/server/lib/dns.js (0 hunks)
  • apps/meteor/app/federation/server/lib/getFederationDiscoveryMethod.ts (0 hunks)
  • apps/meteor/app/federation/server/lib/getFederationDomain.ts (0 hunks)
  • apps/meteor/app/federation/server/lib/http.js (0 hunks)
  • apps/meteor/app/federation/server/lib/isFederationEnabled.ts (0 hunks)
  • apps/meteor/app/federation/server/lib/logger.ts (0 hunks)
  • apps/meteor/app/federation/server/methods/dashboard.ts (0 hunks)
  • apps/meteor/app/federation/server/methods/index.ts (0 hunks)
  • apps/meteor/app/federation/server/methods/loadContextEvents.ts (0 hunks)
  • apps/meteor/app/federation/server/methods/testSetup.ts (0 hunks)
  • apps/meteor/app/federation/server/normalizers/index.ts (0 hunks)
  • apps/meteor/app/federation/server/normalizers/message.js (0 hunks)
  • apps/meteor/app/federation/server/normalizers/room.js (0 hunks)
  • apps/meteor/app/federation/server/normalizers/subscription.js (0 hunks)
  • apps/meteor/app/federation/server/normalizers/user.js (0 hunks)
  • apps/meteor/app/federation/server/startup/generateKeys.js (0 hunks)
  • apps/meteor/app/federation/server/startup/index.ts (0 hunks)
  • apps/meteor/app/federation/server/startup/registerCallbacks.js (0 hunks)
  • apps/meteor/app/statistics/server/lib/statistics.ts (0 hunks)
  • apps/meteor/client/views/directory/DirectoryPage.tsx (1 hunks)
  • apps/meteor/server/configuration/federation.ts (0 hunks)
  • apps/meteor/server/configuration/index.ts (0 hunks)
  • apps/meteor/server/cron/federation.ts (0 hunks)
  • apps/meteor/server/importPackages.ts (0 hunks)
  • apps/meteor/server/methods/browseChannels.ts (1 hunks)
  • apps/meteor/server/methods/createDirectMessage.ts (1 hunks)
  • apps/meteor/server/startup/cron.ts (0 hunks)
  • packages/rest-typings/src/index.ts (0 hunks)
  • packages/rest-typings/src/v1/dns.ts (0 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ggazzo ggazzo added this to the 7.11.0 milestone Sep 24, 2025
@ggazzo ggazzo merged commit f612a7c into chore/federation-backup Sep 24, 2025
8 of 10 checks passed
@ggazzo ggazzo deleted the remove-leftover-old-federation branch September 24, 2025 22:32
@codecov
Copy link

codecov bot commented Sep 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.30%. Comparing base (af73205) to head (3971e13).
⚠️ Report is 15 commits behind head on chore/federation-backup.

Additional details and impacted files

Impacted file tree graph

@@                     Coverage Diff                     @@
##           chore/federation-backup   #37055      +/-   ##
===========================================================
+ Coverage                    67.26%   67.30%   +0.03%     
===========================================================
  Files                         3342     3343       +1     
  Lines                       113649   113656       +7     
  Branches                     20697    20728      +31     
===========================================================
+ Hits                         76450    76496      +46     
+ Misses                       34595    34557      -38     
+ Partials                      2604     2603       -1     
Flag Coverage Δ
unit 71.15% <ø> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 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.

sampaiodiego added a commit that referenced this pull request Sep 25, 2025
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