This adds a try-except block when running html2text when processing raw
messages from HTML to markdown.
convert_html_to_text is added mainly for testing convinience. We don't
have any sample of Mattermosts' problematic content that could trigger
this sort of error yet, so the test mocks convert_html_to_text to raise
error instead.
Until a demo organization creator sets an email address, we want to
restrict other users from joining the organization. Therefore, we
disable changing the "invite_required" setting for the organization
until they set their email address. Otherwise, the owner could
share the demo organization URL with someone and they could create
an account via the homepage.
Checks the demo organization owner delivery email address state
on the server-side.
Disables updating the organization setting in the web app UI.
Enforce checking the demo organization owner delivery email on
the server-side when converting the organization to a permanent
organization via changing the subdomain.
It is possible that a demo organization owner will receive a direct
message from a bot when they haven't yet added an email to their
account, e.g., the Notification bot sends a reminder about watching
the intro to Zulip onboarding video.
Adds a check and early return in handle_missedmessage_emails for
this demo organization owner case.
The test `get_conversation_participants` didn't need
rewiring in the first place.
The filter was not properly created - the field `channel_id`
was wrongly being used instead of `stream_id`.
Once the filter was fixed, the code automatically returned
the expected stream_id and topic, without rewiring.
This eliminated the use of override_rewire in that test.
Fixes part of #32326.
This commit effectively shifts the mocking to a
lower level by mocking `typeahead_list_item.hbs`
instead of higher-level functions like `render_person`,
`render_user_group` and `render_stream`. This helps
eliminate the rewiring of those functions.
These functions are rigorously tested in
`typeahead_helper.test.cjs`.
Fixes part of #32326.
This commit removes unnecessary use of override_rewire
in drafts.test.cjs, and creates data instead of mocking
functions returning that data.
It helped eliminate `stream_data.rewire_get_color` and
`sub_store.rewire_get`.
Fixes part of #32326.
When a demo organization creator confirms their email change for
their account, we now schedule the series of onboarding emails
via enqueue_welcome_emails.
If a demo organization is deactivated/deleted before the emails
are sent, any scheduled emails are deleted as part of that process.
We use the current datetime for getting the onboarding schedule
for the onboarding emails in this case, instead of the datetime the
user joined/created the organization.
The hotkey for 'Toggle compose preview' was not working due to
a small logical bug introduced in 26f664be69.
We were calling `compose.show_preview_area()` when the compose
is already in preview mode, instead of `compose.clear_preview_area()`.
This commit fixes the bug.
This should greatly reduce the symptoms of a bug where a stale
realm_users cache (missing a newly created user) results in the web
client missing the new user and throwing exceptions.
This commit updates code to not prefetch group setting
fields using select_related as we do not need to
prefetch these settings for all the cases and we instead
prefetch these in callers whenever needed.