zulip-terminal icon indicating copy to clipboard operation
zulip-terminal copied to clipboard

Handle (un)subscribe events

Open theViz343 opened this issue 1 year ago • 2 comments

What does this PR do, and why?

This PR adds event handling for (un)subscribe events. Without event handling, ZT crashes if the user narrows onto a message in a stream which is unsubscribed from. This happens mostly when a user is logged in from multiple clients, but can also occur if an admin unsubscribes the user.

Outstanding aspect(s)

  • [ ] Updated subscribed streams frequently have the wrong/default color. (This seems to be an issue of ZT not loading the colors.)
  • [x] ZT crashes when the currently narrowed message is unsubscribed from.
  • [ ] Should we notify user of the new (un)subscription? If yes, then where?(As a popup or as a message in the footer)

External discussion & connections

  • [x] Discussed in #zulip-terminal in Adding streams throws key error
  • [x] Fully fixes #816
  • [ ] Partially fixes issue #
  • [x] Builds upon previous unmerged work in PR #1408
  • [ ] Is a follow-up to work in PR #
  • [ ] Requires merge of PR #
  • [ ] Merge will enable work on #

How did you test this?

  • [x] Manually - Behavioral changes
  • [x] Manually - Visual changes
  • [x] Adapting existing automated tests
  • [x] Adding automated tests for new behavior (or missing tests)
  • [ ] Existing automated tests should already cover this (only a refactor of tested code)

Self-review checklist for each commit

  • [x] It is a minimal coherent idea
  • [x] It has a commit summary following the documented style (title & body)
  • [x] It has a commit summary describing the motivation and reasoning for the change
  • [x] It individually passes linting and tests
  • [x] It contains test additions for any new behavior
  • [x] It flows clearly from a previous branch commit, and/or prepares for the next commit

Visual changes

Preview

theViz343 avatar Apr 24 '23 23:04 theViz343

Hello @theViz343, it seems like you have referenced #816 in your pull request description, but you have not referenced them in your commit message description(s). Referencing an issue in a commit message automatically closes the corresponding issue when the commit is merged, which makes the issue tracker easier to manage.

Please run git commit --amend in your command line client to amend your commit message description with Fixes #816..

An example of a correctly-formatted commit:

commit fabd5e450374c8dde65ec35f02140383940fe146
Author: zulipbot
Date:   Sat Mar 18 13:42:40 2017 -0700

    pull requests: Check PR commits reference when issue is referenced.

    Fixes #51.

To learn how to write a great commit message, please refer to our guide.

zulipbot avatar Apr 24 '23 23:04 zulipbot

Heads up @theViz343, we just merged some commits that conflict with the changes you made in this pull request! You can review this repository's recent commits to see where the conflicts occur. Please rebase your feature branch against the upstream/main branch and resolve your pull request's merge conflicts accordingly.

zulipbot avatar Apr 17 '24 23:04 zulipbot