Filter stream Rules and impact analysis with certain case scenario

Thumb rule: While loading a feed stream, we follow following criteria : 

  1. System should display all the comments and replies with specific date range  

  2. System should display all unhandled comments and replies with specific date range 

  3. System should display all unhandled comments with green mark if page already replied  

  4. System should display replies along with unhandled parent comment though parent comment don’t fall in specific date range (we call it as a ‘suggestion’ to our customer) 

To comply all criteria's, we follow below steps: 

  1. Get first 5 post with pagination and 2 months date limit (For Sheba, it is 4 months) and Get first 10 comments along with 10 replies (For ad post : considering dynamic post (1000 limit)) *

  2. Get all saved tickets handled in last 2 months for these posts (* Performance Impact –1 detail has been explained later)  

  3. Run an iteration of posts to find all comments and replies and apply filter with following criteria 

    1. Run an iteration of comments (* Performance Impact –2 ) 

      1. Run an iteration of replies  

      2. filter replies with date range 

      3. discard comments if it is already a ticket and last reply from page 

      4. if last reply is from another user, consider it as ticket-able, hence parent comment should not be removed 

      5. Mark all replies are ticket and set ticket no 

    2. Discard comments that already a ticket and has no reply

    3. Check comment and all replies are tickets, if no tickatable data found, remove from the list 

    4. check comment is from page and all replies are tickets then remove from the list  

    5. Check date range and discard comments if not fall in specific date range 

    6. if no tickatable data found in this post iteration, then check comments with next pagination and follow steps 3(a-f) (* Performance Impact-2

  4. if no tickatable post found, then check posts with next pagination and follow steps 1 –4 again (* Performance Impact - 3) 

  5. If tickatable data found return post data and display  

 Performance analysis of considering last 2 months Tickets in filter stream 

Our tool has a policy that, we will show last 2 months data to our client. So if any communication comes within this period and not handled, it will consider as ticket-able. Otherwise we will not consider it. 

 User can choose any date range as below:

  • Last 7 days  

  • Last 15 days 

  • Last 30 days 

  • Last 60 days 

  • Custom range within last 60 days  

Currently considering last 60 days ticket data to avoid duplicate ticket scenario is impacting system performance. So we should reconsider it. Lets assume following case scenario’s:   

Using CommEngine tool ,  

Case 1: user chose last 15 days data and start handling 

At first there will not be any ticket so all communication will come in stream and ticket creation date will be today’s date. 

Next day, user chose yesterday’s data, considering user couldn’t handled all.

If we consider ticket range from yesterday to current time, duplicate scenario will not produce and case will pass the validation. 

Case 2: Next day, user chose last 30 days data and start handling 

Last 15 days data already handled so that should be discarded. So if we consider ticket range from selected start date to current date, case will pass the validation. 

Case 3 : If user chose any date range between last 60 days, which time need to consider?here ticket can be handled after end date.

If We consider selected start date to current date, it will pass the validation. 

  1. Proposal 1: make the date range from selected start date to current date instead of last 2 months. 

Do you have any other scenario that might produce duplicate scenario? 

 Exception case (Filter By post Scenario):

Rules: user should see all the comment and replies irrespective of selected date range

To comply that rules we need last 60 days filtration. But if we make some UI changes ,this can be implement within system thumb rule.

  1. Proposal 2: change the rule like ‘filter with selected date range and post’. For that we need to make a little UI changes. Introduce a new button in filter section named ‘Apply’. User will chose the filter criteria and click ‘Apply’. It will reduce Api hit also ,hence we can improve performance