nidhiii128 commented on PR #18:
URL: 
https://github.com/apache/fineract-chat-archive/pull/18#issuecomment-4101965824

   Hi @meonkeys, thanks for the follow-up!
   The JSON is indeed used as the intermediate format. If you look at the 
syncWithHistory method I added:
   
   - It reads the existing JSON state into a Map using the message timestamp 
(ts) as a unique key.
   - It merges the new API results into that map (ensuring idempotency via the 
Map keys).
   - It writes the updated state back to the JSON.
   - The HTML generation (groupByDate(fullHistory)) then uses this combined, 
de-duplicated list rather than the raw API response.
   
   I've also included a unit test syncWithHistoryIsIdempotent to verify that 
duplicate timestamps don't result in duplicate entries.
   
   Also one thing i left doing that the fineract project uses assertion and i 
did System.out.println("DEBUG: Timestamp class is -> " + ...) in the unit test. 
If println is fine then i will keep it or else will change  to assertion.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to