Skip to content

Api docs profile fix#1

Merged
hellokitty09 merged 2811 commits into
mainfrom
api-docs-profile-fix
Mar 27, 2026
Merged

Api docs profile fix#1
hellokitty09 merged 2811 commits into
mainfrom
api-docs-profile-fix

Conversation

@hellokitty09
Copy link
Copy Markdown
Owner

@hellokitty09 hellokitty09 commented Mar 25, 2026

Fixes:

How changes were tested:

Screenshots and screen captures:

Self-review checklist
  • Self-reviewed the changes for clarity and maintainability
    (variable names, code reuse, readability, etc.).

Communicate decisions, questions, and potential concerns.

  • Explains differences from previous plans (e.g., issue description).
  • Highlights technical choices and bugs encountered.
  • Calls out remaining decisions and concerns.
  • Automated tests verify logic where appropriate.

Individual commits are ready for review (see commit discipline).

  • Each commit is a coherent idea.
  • Commit message(s) explain reasoning and motivation for changes.

Completed manual review and testing of the following:

  • Visual appearance of the changes.
  • Responsiveness and internationalization.
  • Strings and tooltips.
  • End-to-end functionality of buttons, interactions and flows.
  • Corner cases, error conditions, and easily imagined bugs.

Summary by CodeRabbit

  • New Features

    • Added two API endpoints for managing your own profile data: PATCH /users/me/profile_data (update) and DELETE /users/me/profile_data (remove).
  • Documentation

    • API docs and changelog updated to describe the new profile-data endpoints and clarify the request format and validation.

sayamsamal and others added 30 commits March 12, 2026 10:57
Commit a071c3a overlooked adding the
`is_compact: true` option to the modal configuration, this commit fixes
that and ensures that the modal has the compact styling.
This commit removes the subtitle-style font color styling from the
modal content for compact modals.
Creates SubscriptionProperty and SubscriptionPropertyValue schemas
that are used for both this endpoint and the bulk endpoint for
updating multiple personal channel settings at the same time.

Updates the descriptions of both endpoints to link to each other
and to link to relevant help center articles.

Co-authored-by: Lauryn Menard <lauryn@zulip.com>
UserBase currently included profile_data, but some endpoints that
reference UserBase (e.g. cross-realm bots) never return profile_data
because they pass custom_profile_field_data=None. This made those
schemas inaccurate.

Moving profile_data into User makes UserBase an accurate base for
endpoints that don't include custom profile field data. Also renames
the profile_data schema to ProfileData.
Codeship reached EOL in Jan 2026.
In preparation for migration to the reference doc.

"Register" and "Registry" are the terms used in the code comments,
but the walkthrough has not used them so far. So, this commit also
introduces these terms in the first paragraph of the section.
This commit adds the is_mirror_dummy field to ensure consistency
with the documented OpenAPI schema in zulip.yaml, which strictly
defines is_mirror_dummy as a boolean property of the deprecated
user object. Earlier, this field was being omitted from the
payload.
We currently convert direct messages if the export file only contains
one team.
This is a prep commit to add multiple test classes.
This updates the mattermost importer to process the most recent version
of mmctl. Changes related to new mmctl version:

- It now generates `import.json` file instead of `export.json` file.

- It may include a couple of new fields such as "bots" for bot users and
"roles" for user roles.

- The direct message object's "members" key is updated to "participants"
key, it's a list of objects now instead of usenames.

This commit doesn't properly handle the "bot" and "role" data yet.

This also adds a more comprehensive export sample from Mattermost
version 11.1.0.
Previously guest users messages would be converted and sent to the
correct channels but they themselves won't be subscribed to any
channels.
The previous documentation was unclear about what `realm_id_str` and
`filename` represent. This updates the descriptions to explain it clearly.
Previously, if the user toggles the preview mode in the compose box before
an image/GIF in the drafted message has been uploaded and thumbnailed,
then the loading indicator shown in the preview of the message will never update.

To address this issue, this commit adds a new cheap endpoint to return the
status of the thumbnail generation. This endpoint will be polled by the compose
box to update the loading indicator.

fixes part of zulip#32961.
Previously, if the user toggles the preview mode in the compose box before
an image/GIF in the drafted message has been uploaded and thumbnailed,
then the loading indicator shown in the preview of the message will never update.

This commit implements a polling mechanism in the compose preview.
When the preview is rendered, we now scan for thumbnail placeholders and
periodically check their thumbnail status. Once a thumbnail becomes
available, the preview is automatically re-rendered to display the image.

fixes zulip#32961.
Previously, the compose box loading spinner would appear every time the
preview re-renders when any thumbnails become ready during thumbnail polling.

This commit fixes it by adding a condition to not show the spinner when
we are re-rendering the compose box during thumbnail polling.
Previously, canceling an upload while the compose preview was open
would trigger a brief, distracting spinner. This happened because
removing the placeholder text triggers a synchronous input,
causing the preview to re-render with the default "show spinner"
behavior.

We now suppress the spinner for this specific interaction by
introducing a flag that is set strictly around the text replacement
operation. This allows us to signal the preview renderer to skip
the spinner for this update.
When zoomed into a stream's topic list, `get_stream_li` only
returns a result for the zoomed-in stream. The previous code
logged a blueslip warning for every other subscribed stream
with unreads on each unread count update, producing a flood
of "stream id no longer in sidebar" console warnings during
normal operation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
shubham-padia and others added 28 commits March 26, 2026 15:37
Fixes
https://chat.zulip.org/#narrow/channel/137-feedback/topic/.22Oldest.20message.22.20in.20long.20topic.20threads/with/2417799

Only messages with corresponding UserMessages are part of
recent_view_messages_data. When navigate_to_anchor_message is called, it
maybe done on views which have historical messages, e.g. a public
channel feed or topic narrow. If found_oldest for the user is true for
recent_view_messages_data, it will try to take the user to their first
message with corresponding UserMessage in the narrow instead of the
actual oldest message in that narrow.

We could have fixed that by checking whether the narrow in question has
historical messages or not. If they do, we could have skipped this
optimisation. But that would require us to keep things in sync with the
backend on which narrows contain historical messages or not. Out of sync
definitions for it on the frontend and the backend would introduce bugs
in the future.

Since we already check locally for the current message list, this
optimisation to look into recent_view_messages_data did not seem worth
it for the maintenance burden it introduces.
Add date format types that use the full month name ("February 12"
and "February 12, 2025") for use in the scroll-to-date popover.
The existing dayofyear formats use abbreviated months ("Feb 12").

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add get_scroll_to_date_suggestions(), which computes up to 4
date suggestions from the locally cached messages in the current
view. The algorithm divides the message volume into equal slices,
then for each slice boundary, prefers a nearby date with a long
silence before it — surfacing dates that start new conversation
bursts after periods of inactivity.

When a conversation has few unique dates, all of them are offered.
Today is excluded since the user is likely already there. All
date grouping and formatting uses the user's configured display
timezone.

This commit adds the function and its tests but does not yet
integrate it into the UI; the next commit will do that.

Fixes part of zulip#38325.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace the hardcoded "A week ago", "Yesterday", and "Newest
message" entries in the scroll-to-date popover with dynamically
computed date suggestions from get_scroll_to_date_suggestions().

The popover now shows "Oldest message", up to 4 date suggestions
drawn from the current message list, and "Custom". Clicking a
suggested date scrolls to the first message on that date, using
the same fast_track_current_msg_list_to_anchor("date", ...) path
as the calendar picker.

Fixes zulip#38325.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Instead of the default of showing the message on center, show it on top.
We extract out the logic to get the offset in a common function since it
is used at another place as well.
This is prep for long-lived event queues for mobile apps. The
`offline` field on ClientDescriptor will track whether a client
has gone without polling long enough to be considered offline.
This is distinct from `expired`, which means the queue should be
deleted entirely.

Also add EVENT_QUEUE_OFFLINE_TIMEOUT_SECS, separate from
DEFAULT_EVENT_QUEUE_TIMEOUT_SECS: the former controls when a
client is considered offline (notification latency), while the
latter is the default queue lifetime.

No behavioral changes in this commit.

Signed-off-by: Prakhar Pratyush <prakhar@zulip.com>
The parameter name was misleading — it tracks whether this is the
last event queue for a given user.

Signed-off-by: Prakhar Pratyush <prakhar@zulip.com>
When all of a user's event queues expire in the same GC sweep,
`last_client_for_user` is True for each, causing `missedmessage_hook`
to fire multiple times. Push notifications are deduplicated,
but email notifications are not.

Signed-off-by: Prakhar Pratyush <prakhar@zulip.com>
Previously, event queues only had one end-of-life state: expired.
When a queue expired, it was garbage-collected and
missedmessage_hook fired to send any pending notifications. With
the default 10-minute timeout, the notification delay was
acceptable.

To support long-lived queues (e.g. 12 hours for mobile), we need
a new "offline" state: after EVENT_QUEUE_OFFLINE_TIMEOUT_SECS of
inactivity, these queues are marked offline and missedmessage_hook
fires, but the queue is not garbage-collected. This way
notifications arrive with ~10 minutes delay, while the mobile
client can reconnect and resume the queue within 12 hours without
a full re-fetch.

receiver_is_off_zulip is updated to treat offline queues as
inactive, so a user with only offline queues is still considered
off Zulip and receives notifications without delay.

Signed-off-by: Prakhar Pratyush <prakhar@zulip.com>
"lifespan" is misleading since queues live much longer than
this value via active polling.

The parameter controls how long the server keeps a queue alive
without the client polling — an idle queue timeout.

No backwards compatibility code is needed for the internal
parameter rename in `get_events_backend` because no production
client currently sends a non-default value. During a restart,
if old Django sends the old parameter name, Tornado will ignore it
and use the default value, which is what was being used anyway.

Signed-off-by: Prakhar Pratyush <prakhar@zulip.com>
Replace the undocumented integer-only idle_queue_timeout parameter
on `POST /register` with a documented parameter that accepts
either a positive integer (seconds) or the string "mobile" to use
the server's recommended timeout for mobile clients (currently
12 hours).

The parameter resolution (None → default 10 min, "mobile" → 12h,
capped at 7 days) happens in ClientDescriptor.__init__, and the
resolved value is sent back through the Tornado response as
idle_queue_timeout_secs, which is included in the `POST /register`
response so clients know the effective timeout.

Signed-off-by: Prakhar Pratyush <prakhar@zulip.com>
This previous only posted messages on the oldest
message day for the first chunk.

Signed-off-by: apoorvapendse <apoorvavpendse@gmail.com>
We pass in message_id to message_store.maybe_update_raw_content
to handle the edge case where the message may have
been deleted from the cache before we get the raw_content
response.

Signed-off-by: apoorvapendse <apoorvavpendse@gmail.com>
This simplifies everything by a great amount and
gives us an interface to directly get the raw_content
without worrying about caching and other details.

We now supply that raw_content response to clients
of message_fetch_raw_content, but don't cache it
if that isn't suitable.

Signed-off-by: apoorvapendse <apoorvavpendse@gmail.com>
Co-authored-by: Steve Howell <showell@zulip.com>
Will be used when we extract functions from
generate_replace_content.
Signed-off-by: apoorvapendse <apoorvavpendse@gmail.com>
Signed-off-by: apoorvapendse <apoorvavpendse@gmail.com>
Signed-off-by: apoorvapendse <apoorvavpendse@gmail.com>
Signed-off-by: apoorvapendse <apoorvavpendse@gmail.com>
This rebranding will be helpful to avoid polluting
the diff when we actually introduce the feature
to quote multiple messages.

Signed-off-by: apoorvapendse <apoorvavpendse@gmail.com>
This prevents unwanted diffs in the commit when we introduce
quoting multiple messages.

Signed-off-by: apoorvapendse <apoorvavpendse@gmail.com>
Added this layer on top of zulip/ci:noble:

/bin/sh -c sudo apt-get update && sudo apt-get -y install --no-install-recommends software-properties-common && sudo add-apt-repository -y ppa:lvoytek/rabbitmq-server-fixes
@hellokitty09 hellokitty09 merged commit 4e6e3d2 into main Mar 27, 2026
11 of 17 checks passed
Copy link
Copy Markdown
Owner Author

@hellokitty09 hellokitty09 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its a good idea but i tempraryly disabled the the ubantu

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.