Skip to content

perf: centralize feed item normalization and aggregation#241

Open
ash1shkumar wants to merge 1 commit into
Shriii19:masterfrom
ash1shkumar:feed-normalization-layer
Open

perf: centralize feed item normalization and aggregation#241
ash1shkumar wants to merge 1 commit into
Shriii19:masterfrom
ash1shkumar:feed-normalization-layer

Conversation

@ash1shkumar
Copy link
Copy Markdown
Contributor

Description

Summary

This PR introduces a centralized feed normalization layer to standardize activity feed item construction across all feed sources. Previously, task and message activities were transformed through separate mapping pathways, resulting in duplicated formatting logic and increasing maintenance complexity as new feed sources are added.

Changes Implemented

  • Added a reusable normalizeFeedItem() helper to centralize feed item construction.
  • Refactored task activity transformation to use the shared normalization layer.
  • Refactored message activity transformation to use the shared normalization layer.
  • Standardized feed metadata generation across activity types.
  • Introduced consistent feed item contracts for future activity sources.
  • Updated manual feed item creation to leverage the same normalization workflow.
  • Improved feed sorting reliability by using original timestamps instead of derived relative-time strings.
  • Reduced duplicated transformation logic throughout the feed aggregation pipeline.

Benefits

  • Improves consistency across all feed entries.
  • Reduces maintenance overhead when introducing new activity sources.
  • Simplifies debugging of feed-generation issues.
  • Provides a scalable foundation for future feed enhancements.
  • Strengthens long-term maintainability of the aggregation workflow.
  • Ensures uniform metadata generation and formatting behavior.

Testing

  • Verified task activities are normalized correctly.
  • Verified message activities are normalized correctly.
  • Verified manually created feed items follow the same transformation contract.
  • Verified feed ordering remains correct after aggregation.
  • Verified pagination behavior remains unchanged.
  • Verified existing API response structure remains compatible with consumers.

Expected Impact

This enhancement establishes a centralized normalization architecture for feed processing, reducing duplication and improving consistency while making future activity-source integrations significantly easier to maintain.

Fixes #202

Expected Labels

level3 NSoC'26

@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 5, 2026

@ash1shkumar is attempting to deploy a commit to the shreemp194-gmailcom's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 5, 2026

👋 Thank you for opening this pull request! I will review your changes and assist you soon.

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.

Centralize Feed Item Normalization Pipeline

1 participant