Commit Graph

65439 Commits

Author SHA1 Message Date
Alex Vandiver
33f7da23a0 stripe: Do not place Realm objects into context. 2025-05-16 11:30:48 -07:00
Alex Vandiver
222729728c password_reset: Do not place Realm objects into context. 2025-05-16 11:30:48 -07:00
Alex Vandiver
0078310be7 find_account: Do not place Realm objects into context. 2025-05-16 11:30:48 -07:00
Alex Vandiver
1e1292f2f5 email_senders: realm_id can exist but be None. 2025-05-16 11:30:48 -07:00
Shubham Padia
d134c1fa01 help-beta: Pass fill property to component instead of str manipulation.
The reason we were doing string manipulation was that when using the
keyboard icon for KeyboardTip.astro, we were getting a blank spot if the
fill was not sent to currentColor. This commit instead passes the
currentColor for the imported unplugin icon directly. This commit only
addresses this specific component, any other instances of the icon color
being same as the page color still remain and this commit does not solve
that.
2025-05-16 11:05:39 -07:00
Aman Agrawal
ac671e2e4b stripe: Fix bugged tracking of invoicing status of plan.
Properly track the current invoicing status using `invoicing_status`
and `invoiced_through` fields.
2025-05-16 10:55:57 -07:00
Evy Kassirer
9eb264d6ed drafts: Clean up is_dm_with_self calculation. 2025-05-16 10:51:29 -07:00
Evy Kassirer
2cbf9e130e drafts: Store DM drafts with user ids instead of emails.
Fixes #34468.
2025-05-16 10:51:29 -07:00
Evy Kassirer
5bb598f615 compose_recipient: Prefer using recipient_ids over emails for current narrow check. 2025-05-16 10:51:29 -07:00
Evy Kassirer
efda73536f compose: Prefer using recipient_ids over recipient_emails. 2025-05-16 10:51:29 -07:00
Evy Kassirer
ea7a2570bf compose_ui: Convert ComposeTriggeredOptions to use PM user ids. 2025-05-16 10:51:29 -07:00
Evy Kassirer
38bf407c9a compose_actions: Migrate start() to use pm recipient ids. 2025-05-16 10:51:29 -07:00
Evy Kassirer
464b7f4540 compose_state: Rename private_message_recipient to clarify it stores emails.
This will add clarity as we move towards using ids more and emails
less.
2025-05-16 10:51:29 -07:00
Anders Kaseorg
b3ef64c932 integrations: Remove obsolete .integration-create-your-own references.
Commit 7c485c1302 (#17654) removed this
class.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-05-15 18:24:49 -07:00
Anders Kaseorg
8e9de0b053 configure-rabbitmq: Restore startup retry loop.
‘rabbitmqctl await_startup’ does not retry to wait for the Erlang
runtime to start, only to wait for the RabbitMQ application to start
once Erlang is running.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-05-15 16:59:27 -07:00
Tim Abbott
9feae92a63 version: Update version for Zulip Server 10.3 release. 2025-05-15 16:07:29 -07:00
Sahil Batra
d2ff4bda4c streams: Check creation permission when updating channel privacy.
User who did not have permission to create public channels
could create them by first creating a private or web-public
channel, if they had the permission to create them, and then
changing privacy of that stream to be a public stream.

Similarly user without permission to create private channels
could also create them.

This commit fixes both these bugs.
2025-05-15 15:37:41 -07:00
Alya Abbott
d3b9dfa997 new: Tweak import tip. 2025-05-15 14:04:20 -07:00
Mateusz Mandera
53aaa0e918 sync_groups: Don't allow syncing of system groups.
Trying to sync system groups with this would easily lead to database
corruption and we should completely disallow it.
2025-05-15 14:02:57 -07:00
Aman Agrawal
1dc845f07b users: Allow spectators to access /users API endpoint.
We need this to support faster initial loading time for spectators.
2025-05-15 12:37:29 -07:00
Shubham Padia
078a27def2 help-beta: Convert admonitions to asides and KeyboardTip.
Fixes #31249.
We have converted `warn` to `note` since that was the translation that
remains most faithful to how we display `warn` admonitions in our
current help center implementation. See
https://chat.zulip.org/#narrow/channel/19-documentation/topic/Stage.202.3A.20New.20syntax.20for.20!!!tip.20in.20help-beta/near/2174415
for more details.

We've also duplicated code from Python-Markdown to represent how
admonitions worked there more accurately. Duplication should be fine
since this is a one-off script and Python-Markdown is not a project
that's gonna change drastically in the future.
2025-05-15 11:53:40 -07:00
Shubham Padia
9d9b0c01fc help-beta: Add KeyboardTip component.
We also add unplugin types to tsconfig.json. We didn't need them before
since those types were not used in any astro components and were used in
mdx files directly instead.

We have an open PR to the upstream starlight repository to add support
for custom icons in the Aside starlight component. The PR is stalled
due to dependency on some of the custom icons work being done on
starlight. We should replace the code below with the Aside starlight
component along with a custom icon (keyboard in out case).
Not linking it directly to avoid necessary mentions on the original PR
whenever this commit is pushed. The PR number is 2261 in
https://github.com/withastro/starlight.
2025-05-15 11:53:40 -07:00
Shubham Padia
231cae594e help-beta: Set svg fill color explicitly to currentColor.
unplugin-icons suggests to set the fill color, there were some cases
were it was being set to none.
2025-05-15 11:53:40 -07:00
Sayam Samal
46c568cace channel_settings: Fix advanced configurations subsection toggle area.
This commit fixes the toggleable area of the advanced configurations
subsection in the channel settings, preventing the toggle action from
interfering with the save discard widget.
2025-05-15 11:16:59 -07:00
Sayam Samal
7d8e32da6a channel_settings: Show tooltip for invalid message retention period. 2025-05-15 11:16:59 -07:00
Sayam Samal
154bb67f9f settings: Fix absent save/discard widget for empty message retention.
This commit fixes the state where the save/discard widget was not being
shown when the custom message retention input was empty, by not
defaulting to settings_config.retain_message_forever (-1) as the value,
when the input field is empty.
2025-05-15 11:16:59 -07:00
Sayam Samal
98ab25c623 settings: Show tooltip for invalid message retention period. 2025-05-15 11:16:59 -07:00
Sayam Samal
0914732387 settings: Improve enable_or_disable_save_button method code.
This commit reorganizes the code in enable_or_disable_save_button
method, and improves its readability. It also replaces the previous
tooltip logic for the disabled save button in the save/discard widget
with the more standardized methods to handle the same from ui_util.ts.
2025-05-15 11:16:59 -07:00
Sayam Samal
30bfabb2eb ui_util: Improve enable_element_and_remove_tooltip method logic.
This commit improves the enable_element_and_remove_tooltip method to
only unwrap the disabled element from the tooltip wrapper, once we
confirm the wrappers existence.
2025-05-15 11:16:59 -07:00
Sayam Samal
10716c8f4d ui_util: Improve disable_element_and_add_tooltip method logic.
This commit reinforces the disable_element_and_add_tooltip method
logic to factor in the edge case where the element in question is
already disabled and wrapped in a tooltip attached container and the
method is called again.
2025-05-15 11:16:59 -07:00
Mateusz Mandera
2cd6f07ffe ldap: Extract sync_groups function from sync_groups_from_ldap.
This extracts the core general group-syncing logic, which is independent
of any LDAP-specific concerns, to a separate function. This allows the
use of this core logic for group sync in other authentication backends.

The code also gets a bit cleaned up in the process to make it more
readable (with some readability tweaks to the log strings as well).
2025-05-15 10:20:28 -07:00
Evy Kassirer
0b3328f7b3 peer_data: Ensure potential_subscribers is only called with full data.
Work towards #34244.

We can guarantee this because the add subscriber typeahead (and the
rest of the subscribers tab) is only visible once subscribers have
been loaded.
2025-05-14 15:00:45 -07:00
Evy Kassirer
44b87c72dc stream_edit: Fetch subscribers before showing subscriber tab.
Work towards #34244.

Now that we're supporting partial subscriber data, we might need
to fetch the full list of subscribers when opening the subscribers
tab of the edit channel modal.

This commit handles a slow load with a loading spinner while we fetch
the data, and also makes sure to ignore the data if it's received after
it stops being relevant (in case the user has another stream's data open).
2025-05-14 15:00:45 -07:00
Evy Kassirer
a327278a73 stream_settings: Remove can_access_subscribers from template.
`can_access_subscribers` is true for every stream which the user has
metadata access to and we only show the streams in overlay if user
has metadata access to it.

Discussion here:
https://github.com/zulip/zulip/pull/34543#discussion_r2087949980
2025-05-14 15:00:45 -07:00
Aman Agrawal
906b96cdfc test_stripe: Fix weak URL testing.
The host of this URL could have been forged to redirect user
to a different subdomain and tests would still pass.

This also fixes the CodeQL warnings related to it.
2025-05-14 13:45:35 -07:00
Aman Agrawal
e04a32dee6 stripe: Upgrade API_VERSION to "2025-04-30.basil".
This involves the following major changes to the code:
* `Invoice.upcoming` removed in https://docs.stripe.com/changelog/basil/2025-03-31/invoice-preview-api-deprecations.

* InvoiceItem always needs to be created with an Invoice id for
  InvoiceItem to be attached to the Invoice.

  This seems to just be required after the upgrade and looking at
  stripe python SDK history, this was how it was always supposed to work.

  This is a welcome change since it adds to the clarity of the code.

* Change due to following breaking changes:

  - https://docs.stripe.com/changelog/basil/2025-03-31/invoice-pricing-configurations
  - https://docs.stripe.com/changelog/basil/2025-03-31/add-support-for-multiple-partial-payments-on-invoices

  which removes and adds various parameters and attributes to the
  invoice related objects.

  Also, out of band invoices now count in `amount_paid` in Invoice as
  part of above linked changes.

  See https://github.com/stripe/stripe-python/blob/master/CHANGELOG.md
  for an easier to search list of changes.

* Removed `proration` parameter from testing since we were not using it
  and testing its constant `false` value would require us writing more
  custom code to access its value.

* Added test for "usd" for the currency, since there were some changes
  in the API related local currency and I wanted to check Invoices
  were being created as expected.
2025-05-14 13:45:35 -07:00
Aman Agrawal
3cdda91afe stripe: Link InvoiceItem to Invoice.
This is required for upgrading to the basil version of stripe.
Changes haven't been tested in this commit. It is just for easy
verification of changes.
2025-05-14 13:45:35 -07:00
Aman Agrawal
6fb7a21cef stripe: Update plan in database outside for loop.
Since we are not doing an early return here and the updated information
is not immediately used, we can skip updating the plan in database
till the end of for loop.
2025-05-14 13:45:35 -07:00
Aman Agrawal
ba9d183721 stripe: Only create flat discounts for renewal invoices.
If we only created invoice for additional licenses, we don't need
to add discount to the invoice.

Changes haven't been tested in this commit. It is just for easy
verification of changes.
2025-05-14 13:45:35 -07:00
Aman Agrawal
0a1f84fba1 stripe: Link InvoiceItem to Invoice.
This is required for upgrading to the basil version of stripe.
Changes haven't been tested in this commit. It is just for easy
verification of changes.
2025-05-14 13:45:35 -07:00
Aman Agrawal
c0504777b2 stripe: Link InvoiceItem to Invoice.
This is required for upgrading to the basil version of stripe.
Changes haven't been tested in this commit. It is just for easy
verification of changes.
2025-05-14 13:45:35 -07:00
Aman Agrawal
1a516f8b04 stripe: Link InvoiceItem to Invoice.
This is required for upgrading to the basil version of stripe.
Changes haven't been tested in this commit. It is just for easy
verification of changes.
2025-05-14 13:45:35 -07:00
Aman Agrawal
cfa7458797 stripe: Link InvoiceItem to Invoice.
This is required for upgrading to the basil version of stripe.
Changes haven't been tested in this commit. It is just for easy
verification of changes.
2025-05-14 13:45:35 -07:00
Aman Agrawal
af4cee9479 stripe: Link InvoiceItem to Invoice.
This is required for upgrading to the basil version of stripe.
Changes haven't been tested in this commit. It is just for easy
verification of changes.
2025-05-14 13:45:35 -07:00
Aman Agrawal
f8abfa2936 test_stripe: Add check for initially added card. 2025-05-14 13:45:35 -07:00
Aman Agrawal
625118bbb5 test_stripe: Add explanatory comment. 2025-05-14 13:45:35 -07:00
Aman Agrawal
567cf3c127 test_stripe: Fix incorrect pattern replacement in fixtures.
When normalizing fixture data, all numbers were being
replaced if they matched `exp_month`. This can lead to various
errors and flaky fixture generation. We use a pattern match
which includes the parameter being matched to fix this.
2025-05-14 13:45:35 -07:00
Aman Agrawal
104a7dd7a0 test_stripe: Don't return None on mocked return of stripe functions.
When mocking stripe function, don't return `None` as it can be
treated as the call was unsuccessful by the code being tested.
2025-05-14 13:45:35 -07:00
Aman Agrawal
9bcdaee065 test_stripe: Add clarification comment.
Wasted some time on this today, so decided to leave a comment here.
2025-05-14 13:45:35 -07:00
Aman Agrawal
fbec6ab123 stripe: Only attempt payment if invoice is not paid.
Since it is possible that invoice can be paid before we reach here,
so only attempt payment if the invoice is not marked as 'paid'.

Fixes invoice already paid error from stripe when running tests.
2025-05-14 13:45:35 -07:00