You are currently viewing Fhetch Chat application

Fhetch Chat application

  • Post published:January 22, 2020

SYNOPSIS:

Team span: Currently Active
Implementation Duration: 5 Weeks
Technology: RoR, PostgreSql, Swift, iOS
Development Manager: Farrukh Iqbal
Engineer: Sarmad Tabassum and Shmeel Ahmad

Fhetch is a mobile application which facilitate users to chat and share pictures and request pictures. Client came up with already developed application which was neither stable and had many performance issues. Some of them are listed below

  • Messages use to take at least 10 second to deliver.
  • Messages and photo statuses not updated and most of the time get stuck at one status e.g message is read but on sender side keep showing sent
  • User get logged out without any reason
  • User see encrypted messages in their chat box
  • Two people join the app but could not communicate with each other

To resolve the above issues we need to identify the cause which was not straight forward for some because there was no scenario to generate these issues again. By adding detail logging in code we identified below listed causes for most of the issue

  • Multi threading was used to schedule the jobs to deliver the notification and the threads were not closing properly and keeping a continuous connection with database. This was leading to no response from database for further queries.
  • The complete application was relying on APNS notifications to deliver the messages and photos which was causing the long delays
  • Rails conventions were not followed and mistakes in queries were the reason for remaining few issues

We integrated sidekiq with redis to handle the notifications delivery jobs and eliminated the buggy multi-threading code. Integrated Action Cable for notifications delivery which resolved the major issue of performance. Refactored the code according to rails conventions and optimized the queries to further enhance the performance and resolve the relevant issues.

Tools & Technologies Used:

RoR, Sidekiq, Redis, Action Cable, PostgreSql,

Conclusion:

Now every message and photo is delivered in real time and the application is stable.