Skip to content

Instantly share code, notes, and snippets.

@akshatdalton
Last active August 26, 2023 18:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akshatdalton/d2e3a0b37a5ce32fb128de69cee38f38 to your computer and use it in GitHub Desktop.
Save akshatdalton/d2e3a0b37a5ce32fb128de69cee38f38 to your computer and use it in GitHub Desktop.
GSOC 2023 Final Report

Google Summer of Code 2023 with Zulip

Final Report

Hi, there! This is Akshat and here I have documented the projects and tasks that I have done during my GSoC period, 2023. My contributions include minor bug fixing to major feature integration changes.

PRs merged during the GSoC time period:

  • (#26165) test-backend: Enable single-threaded profiling when thread count is unspecified.

    • If the number of threads is not specified while profiling then use a single thread. This is because profiling across multiple threads (earlier default behaviour) may obscure the accurate measurement of which functions are the most costly due to thread blocking.

  • (#26050) message_view_header: Fix bad rendering of stream links in description.

    • This bad rendering was the result of unwanted css applied in the stream description. In message view header, the stream link (title) we have defined has css defined but the markdown rendered stream link in stream description had the same class resulting in unwanted css applied to it.

  • (#25818) narrow: Fix topic highlighting issue with apostrophes in search results.

    • This commit addresses the issue where the topic highlighting in search results was offset by one character when an apostrophe was present. The problem stemmed from the disparity in HTML escaping generated by the function func.escape_html which is used to obtain topic_matches differs from the escaping performed by the function django.utils.html.escape for apostrophes (').

      func.escape_html django.utils.html.escape
      ' '

      To fix this SQL query is changed to return the HTML-escaped topic name generated by the function func.escape_html.

  • (#26429) Refactor: Use add_narrow_conditions in messages_in_narrow_backend.

    • The messages_in_narrow_backend function was directly calling NarrowBuilder instead of utilizing the add_narrow_conditions method like fetch_messages does.

      This behaviour was not combing any search operands together as it happens inside the add_narrow_conditions.

Pending/Work-In-Progress PRs:

  • (#19554) typeahead_helper: Update typeahead priority order logic for recipients.

    • This update was necessary as two users generally had different typeahead list in stream-topic messages, like for User1, he/she may have target_user (who is a recent sender) in his/her typeahead list but for another User2, it may not be the same. In most of these situations, users are most likely to tag the recent senders.

      Moreover, if a user types: @ - then wildcard mentions used to appear on top. This was in some sense implied that we want to encourage the users to use wildcard mentions more often which is not true.

      Typeahead sorting for stream-topic conversations has the order of priority is as follows:

      1. Users who have sent messages to the current topic over those who haven't sent to the current topic.
      2. Users who have sent messages to the current stream over those who haven't sent to the current stream.
      3. Subscribers over non-subscribers.
      4. Users have PMed with over users haven't PMed with.
      5. Current user interaction with the rest of the users.

      Wildcards are given the following preference over:

      • non-subscribers
      • users who have not participated in topics
      • and the users with whom the current user hasn't PMed.

      Typeahead sorting for PM conversations has the order of priority as follows:

      1. Users who have PMed with each other over those who haven't.
      2. Recipients with higher counts.
      3. Normal users over bots.
      4. Users with shorter names over those with longer names.

      Wildcards are given the following preference over the users with whom the current user hasn't PMed.

  • (#17511) markdown: Re-enable backslash escape inline pattern.

    • This re-enables the backslash escape inline pattern. This uses upstream EscapeInlineProcessor and ESCAPE_RE. We have extended the list of ESCAPED_CHARS to all the ASCII punctuation characters, to follow CommonMark. We also change the frontend static/third/lib/marked.js such that it follows backend logic (mostly).

  • Use Chrome Idle detection to update user status (Link to POC)

    • This change will be necessary because users who are not interacting with Zulip in the web app are shown as an idle state where Zulip can't distinguish the user being at their computer and not having tabbed to the Zulip window in the last 4 hours from they left Zulip open on their desktop at work 4 hours ago are at home asleep.

  • (#25677) narrow: Add support for anchoring messages by date.

    • This adds a new anchor_date parameter which needs to be used in conjunction with the anchor parameter set to date value. It allows to anchor the view to the messages that are closest to the specified searched date (provided via anchor_date).
    • Added frontend support for date filter.
    • Added search suggestion for date filter.

  • (#25885) notifications: Fix bad rendering of math formulas.

    • This fixes the bad rendering of math formulas in the email notifications. For the emails having math formulas like: $$d^* = +\infty$$ includes them three times in a row (once as unicode, once as latex, again as unicode). This was because we were displaying KaTeX HTML without the CSS.

      This is fixed by showing the raw LaTeX source.

  • (#26517) narrow: Fix topic highlighting issue with apostrophes in search results.

    • This PR was raised because of the conflicting changes merged in #25818.

  • (#26532) fenced_code: Enable code-highlighting without language markers.

    • The 'startinline' option is utilized in the CodeHilite instantiation to indicate that the provided code snippet should be highlighted even if it doesn't start with the opening tag or marker of the associated programming language.

      This is particularly useful in scenarios involving languages like PHP, where users may not want to include the <?php marker at the start of their code blocks.

I will try to get most of these PRs merged after the GSoC period.
To view my all merged commits, please check this link.

I've other PRs (opened while I was working with Zulip in 2021 - Link for GSoC 2021 final report) which I'll try to revive again and get merged after proper discussion with the team at Zulip.

My weekly progress during the GSoC'23 project period can be found in #GSoC>Akshat - checkins.

Final Words:

My GSoC experience with Zulip has been amazing for me. I would like to thank the whole community for this, especially my mentor Dinesh Chidipothu and Tim Abbott for such an amazing experience. I look forward to continuing to contribute to this community and I am grateful that I again chose Zulip as my Open Source organization.

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