Removes send_new_subscription_messages parameter from
`POST channel/create` endpoint as Notification Bot DMs
are never sent when users are subscribed as part of
creating a new channel.
Not considered a documentable API change, since the previous parameter
never had any effect, so this is effectively just a documentation and
error-handling bug fix, not an API change relevant to implementors.
Updates comments in send_user_subscribed_and_new_channel_notifications
so that it is clearer what notification each "if" block of the function
is generating.
Also, moves variables that are only used in the user subscribed DMs to
that "if" block.
Because send_messages_for_new_subscribers also sends channel
notification messages about newly created channels, a clearer
name for is send_user_subscribed_and_new_channel_notifications.
Earlier, message notifications for same key would not get grouped
together because of the old notification_object close event listener
firing up when not supposed to.
This commit fixes this behaviour by checking the notification object
instance is the same as the currently displayed notification object
from notice memory when closing it.
Co-authored-by: prakhar1144 <prakhar@zulip.com>
In `send_push_notifications`, we were manually asserting types of the
fields returned by the `remotes/push/e2ee/notify` endpoint at runtime
and constructed the `response_data` data structure for further use.
Pydantic is the perfect tool for this task.
This commit updates the concerned code to use Pydantic's `TypeAdapter`.
No functional change.
Fixes part of #35368.
Refactoring, no functional change.
This commit refactors `send_e2ee_push_notification_apple`
and `send_e2ee_push_notification_android` to return a
`SentPushNotificationResult` dataclass.
It's a cleaner protocol than passing a mutable data structure
`delete_device_ids` as argument and updating it within
functions.
Fixes part of #35368.
Contrary to what the comment implied, the remaining `fetch_tweet_data`
function would never return a cache hit, as it is namespaced by the
current deploy's cache key.
This will appear to _increase_ time spent in memcached, according to
our access logs. This is because we used to apply zlib compression
twice -- once, outside of our performance logging, and a
second (ineffectual) time inside. We now only compress once, which
reduces the overall time, and accounts for it more correctly.
This reverts commit f119c33789.
With 51cef01c29 merged, there is no need
to fetch .recipient here, as it won't be accessed by the delete messages
codepath.
I noticed that when you are in a group dm narrow
and open drafts, the overlay-message-row class
is inside different containers, and the nth last
child check does not apply for that case, which is
why the test failed.
More generally, last-child is just not a good selector for robust
testing.
Signed-off-by: apoorvapendse <apoorvavpendse@gmail.com>
Links become unclickable if the following is true:
1. Composebox is open
2. You have selected some text
Currently doing this will prevent the default click behavior
which is a big bug and can get quite annoying.
We now switch to a more robust check which only prevents the
click behavior if some drag evidence is present, determined with
`mouse_drag.is_drag`
Signed-off-by: apoorvapendse <apoorvavpendse@gmail.com>
When run from cron, reload-server (and thus reload-clients) picks up
the `HTTP_proxy` environment variable, which redirects HTTP requests
through Smokescreen -- which prevents localhost requests. This
results in clients never getting sent reload events.
Explicitly unset proxies when talking to localhost in reload-clients.
We enforce at registration time that hostnames with deactivated=False
must be unique, though we do not enforce it in the database because we
have historical data for which that is not true.
However, we should perform all hostname lookups with a
`deactivated=False` filter, as that will resolve the majority of
`RemoteZulipServer.MultipleObjectsReturned` errors. Once the
production data is cleaned up, this can be enforced via a partial
unique index.
This avoids a potential unnecessary message.recipient fetch required by
is_stream_message(). is_stream_message() methods precedes the addition
of the denormalized is_channel_message column and is now unnecessary.
In practice, we usually fetch Message objects with `.recipient` already,
so I don't expect any notable performance impact here - but it's still a
useful change to make.
As per the type definition of `NarrowTerm`,
the operand should be a string.
This bug caused exceptions each time a topic was
clicked in the left sidebar.
Previously, tooltip templates were identified using the
group's name in their `id` attributes.
This change uses the group's ID instead, which is more reliable.
Previously, tooltip templates were identified using the
stream's name in their `id` attributes.
This commit changes the tooltip IDs to use the stream's ID instead,
rather than its name, to ensure uniqueness and avoid potential conflicts.