Skip to content

fix(chat): fix to show thread after creation - #7058

Merged
AndyScherzinger merged 2 commits into
masterfrom
fix/new-thread-root-shown-as-thread
Nov 19, 2026
Merged

AndyScherzinger merged 2 commits into
masterfrom
fix/new-thread-root-shown-as-thread

Conversation

@mahibi

@mahibi mahibi commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

The server relays a new message before it creates its thread, so the relayed copy of a thread's root
has no thread data. The app never marked the root afterwards, so a thread created on the phone showed
up as a normal message. The relayed parent of an edit or delete of a thread message has no thread data
either, and storing it removed the thread data of the stored message.

  • When thread messages are stored (e.g. the THREAD_CREATED system message), the stored root of their
    thread is marked as a thread root with the thread's title and reply count. This happens in the same
    transaction that stores the messages, without a request to the server. A root that is already marked
    is not changed. The reply count keeps following new messages through the existing update from fix(chat): keep the reply count of a thread up to date #7034.
  • When a copy of a message without thread data is stored (the relayed parent of an edit, delete,
    reaction or poll vote, or a parent message fetched for a reply), the stored thread data is kept.

How to test

  • create a new thread in the app
  • On master it's shown as a normal message, with this branch it is shown as a thread

🏁 Checklist

  • ⛑️ Tests (unit and/or integration) are included or not needed
  • 🔖 Capability is checked or not needed
  • 🔙 Backport requests are created or not needed: /backport to stable-xx.x
  • 📅 Milestone is set
  • 🌸 PR title is meaningful (if it should be in the changelog: is it meaningful to users?)

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@mahibi mahibi self-assigned this Nov 17, 2026
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

📱 QA build

Download app-qa-debug.apk
QR code Open the QR code for this download
Commit 549347c
Version 7058
Available until 7 days after this build

The QA build installs alongside a released Nextcloud app, so you can keep
using your existing install while testing.

Downloading the file requires a GitHub account, so open this link on the
device you want to test on, or transfer the APK to it.

The server relays a new message before it creates the thread for it,
so the relayed copy of a thread's root message carries no thread data.
The response to the send request is not stored, and nothing marked
the root afterwards, so a thread created on the phone showed up as a
normal message. The relayed parent of an edit or delete of a thread
message carries no thread data either, and storing it removed the
thread data of the stored message.

When a thread message is stored while the stored root of its thread
has no thread data, fetch the thread and mark the root with its title
and reply count, the way the iOS and web clients repair it. When a
copy of a message without thread data is stored, keep the thread data
of the stored message, as a message never stops belonging to a
thread.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Fetching the thread to mark its root made storing messages wait for a
network request, also in the non-cancellable pull, and a failed
request was repeated for every later message of the thread.

Every thread message, e.g. the THREAD_CREATED system message, carries
the title and reply count of its thread, so mark the root from them
in the transaction that stores the messages. The root is marked only
while it has no thread data, so older data never replaces newer data,
and it gets its own id as thread id, as a root stored without thread
id would otherwise be shown as a reply of another thread.

The parent messages fetched for replies keep the stored thread data
as well.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
@mahibi
mahibi force-pushed the fix/new-thread-root-shown-as-thread branch from 37d1e9f to 549347c Compare November 18, 2026 12:17
@mahibi
mahibi marked this pull request as ready for review November 18, 2026 12:28
@mahibi mahibi added this to the 26.0.0 milestone Nov 18, 2026
@mahibi mahibi added the 3. to review Waiting for reviews label Nov 18, 2026
@mahibi
mahibi requested a review from rapterjet2004 November 18, 2026 12:29
@github-actions

Copy link
Copy Markdown
Contributor

Codacy

Lint

TypemasterPR
Warnings1716
Errors00

SpotBugs

CategoryBaseNew
Bad practice77
Correctness88
Dodgy code4040
Internationalization33
Malicious code vulnerability33
Performance77
Security1111
Total7979

@AndyScherzinger
AndyScherzinger merged commit 3392d1e into master Nov 19, 2026
21 of 22 checks passed
@AndyScherzinger
AndyScherzinger deleted the fix/new-thread-root-shown-as-thread branch November 19, 2026 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews AI assisted

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants