Skip to content

Instantly share code, notes, and snippets.

@manavmehta
Created August 25, 2020 17:09
Show Gist options
  • Save manavmehta/4acf7bf3720f6e87bf24ec5295c1cb84 to your computer and use it in GitHub Desktop.
Save manavmehta/4acf7bf3720f6e87bf24ec5295c1cb84 to your computer and use it in GitHub Desktop.

Google Summer of Code 2020 @ Zulip - Project Report

I've never been a blog person but as my GSoC concludes, it's the best time to do a write-up about how I started, what I experienced, and what I loved about and gained from the program.

project chat

About the project

I would like to express my gratitude towards my mentors Abhigyan Khaund and Akash Nimare for being extremely guiding, friendly and resourceful and helping me throughout my GSoC period even before it officially began.

Zulip as an organization is extremely fun, connected and more like a well-knit-family. Contributors work dedicatedly as they are maintainers and the work should be of good quality as Friends Don't Let Friends Ship Inaccessible Code.

My project was primarily oriented towars making Zulip's desktop client a better overall in terms of UX and features. I worked with my mentors, who were readily available throughout my GSoC period, to work on the high priority issues as Zulip is an end-user centric product and we want our users to have the best experience.


Highlights of the work

Merged Pull Requests

The application used to fetch system locale and use it as the application language. A feature request came demanding an option to change the application language without changing system locale. A dropdown was implemented which would allow user to select their preferred language without changing system locale.

There were two different reset options - Factory Reset and Reset App Data - which had two different paths and caused ambiguity for the end-user. The latter one was removed and the former was refined to completely reset the app as if it were just downloaded and installed on the system.

User Agent was repetedly reported to be incorrectly cached as the application used to store it on disk and update it only when it's not present thus, caching the old value and sending the server wrong version. In addition to it, in Anders Kaseorg's words, storing on disk wouldn't be a good option as The disk is much less efficient than memory—up to hundreds of thousands of times slower, Repeatedly writing to a solid-state disk wears it out slowly over time, Without properly synchronizing the disk accesses (using IPC!), we might read stale values.

To rectify this, we made the app to generate User Agent everytime it is fired up and made IPC call to fetch it from the main process into the renderer and send it to the server.

For macOS, in dark theme, Zulip Desktop had a white logo coherent to other logos int he system tray, but in light theme it had the signature logo which would break the coherence. We used Electron's Template Image which has a black and an alpha channel to automatically adjust to the theme and provide a more flushed experience.

Earlier, Zulip Webapp and Zulip Mobile used Transifex as it's translation clients where translators can translate each string independently. Zulip Desktop used JSON modules without any service so users would have to change the translation string and make pull requests which was very chaotic and inefficient.

Transifex client was set up for Zulip Desktop which allowed translators to tarnslate the files on Transifex server and the maintainer only needs to sync the translations before making a release.

Earlier, Zulip Desktop used a non-native package - electron-spellchecker from electron-userland - to spellcheck. Electron added support for native spellchecker and the app thus migrated from using the 3rd party module to native module.

One drawback that came with it was the lack of a context menu and thus it was created according to the needs of the desktop client.

I, myself, first reported the issue which was very frustrated but was not consistetly reproduced but then many user's confirmed this one and upon digging in, two definitions, one from electron's roles and another one the app was using, were clashing. The clash was fixed and so were the zoom issues.

The request package the desktop application used was deprecated and thus a need arose to use a regularly maintained module. Electron's native net API came to the rescue. net.request was chosen as the replacement which, as bonus, handled the proxy and also added the support for system certificate store. Earlier Zulip had Zulip Certificate Store where users would add certificates separately. Now, if the users have added certificate to your system store, like the way they do for Chrome/Chromium apps, there is no need to do the same for Zulip app. It's a win-win, right? 😁

Open Pull Requests

DND (Do Not Disturb) has been present in Zulip Desktop but an idea of configuring it with some time interval which would automatically go off has been there and needed implementation. This PR adds the support for time based DND mode using node-schedule npm package which schedules a node-schedule job at a given time from the present. The job had instruction to disable the DND mode at that time. It also has an 'Until I Disable' option if user likes to go old school. 😄

Vipul Sharma started BrowserView migration in #D793 and Kanishk Kakar picked it up in #D831. The PR was still not merged and a lot of work had been done and it required rebasing cleaning and some redefinitions.

The PR is a WIP.

Many users reported the issue on macOS where when they received a notification, it would make the sound but won't generate the push notification which was annoying. As a potential solution, we are moving away from the 3rd party node-mac-notifier npm package to electron's native Notification API.

The PR is a WIP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment