Newsfeed

Amish Mittal (fliptrail)

A big shoutout to
my mentors

and the community

Peter Lepeska
Karan Bedi
Devin Toth
Eric Rosenthal
Jay Hepburn

Quick Intro

Amish Mittal

Online Handles: fliptrail

Aboard World Dream, Hong Kong

Freshman Year
Computer Science and Engineering - B.Tech
Indian Institute of Technology Patna (IIT Patna)

New Delhi, India

Research Interests

Machine learning/Deep learning

Drones (UAVs)

Probabilistic/Random Algorithms

NodeJS and database performance and scalability

How gullible are we?

Fandom spread and outreach

Network/ Server Assign Operation

Back to Newsfeed

To create a functional Newsfeed like Facebook, WeChat, Instagram has

Newsfeed for Rocket.Chat

Unconventional but very benefitial

  • Increased User Retention

  • Accountability

  • Discovery

  • Social

"Customised read-only channel for every user"

or is it ???

Server Setting for the admin

Channel type 'n'

news_${ user._id }

example: news_d7wbJaQoMKhcuzWAX

for every user

URL: localhost:3000/newsfeed/news_LhWuzaojZPbEw3Ny5

Recent thoughts

This won't be necessary

Follower/ Following model

User Relations Collection

based like the current User Subscription model

Collection name

rocketchat_user_relations

{
    "_id" : "Djc3G7TNoaBQthedW",
    "following" : "FDG6GigmTGkaZ8cfT",
    "follower" : "CqkJoboStxtJFs9je",
    "_updatedAt" : ISODate("2019-07-03T09:19:18.374Z")
}

Original Channel Indicator

The 2 parameters - change in sequencing

Normal Query for Message

const query = {
	_hidden: {
		$ne: true,
	},
	rid: roomId,
	ts: {
		$lt: timestamp,
	},
};

return this.find(query, options);

Newsfeed Query for Message

let query = {
	_hidden: {
		$ne: true,
	},
	$or: following,
	ts: {
		$lt: timestamp,
	},
};

$or: following
Array which contains all the people followed

But, this would return all the messages, including which the user may not have access to

canAccessRoom

Final Query

query = {
	_hidden: {
		$ne: true,
	},
	$and: [
		{ $or: following },
		{ $or: listOfAccessibleRoomsObject },
	],
	ts: {
		$lt: timestamp,
	},
};

Message Summarization

Based on time, sender and channel currently

Before

After

Live Demo

socialprototype.viasatconnect.com/

Performance

  • User Relations
  • Queries and message retrieval
  • Embedded
  • Summarization is much heavy on client side

Bugs currently

  • Sometimes reload is required
  • No unread indicator
  • Channel ID to Channel Name

Analysis of time series data

Current and Further steps

  • Proper Summarization method - not only room and time based
  • Messages from bots/ announcements/ advertisements
  • Messages which do not belong to any author
  • Jump to message using permalink

Thank You

Newsfeed

By Amish Mittal