Skip to content

Report the outcome of reminders and shares to notes instead of guessing it - #6717

Merged
AndyScherzinger merged 3 commits into
masterfrom
feat/noid/optimisticReminders
Oct 17, 2026
Merged

AndyScherzinger merged 3 commits into
masterfrom
feat/noid/optimisticReminders

Conversation

@AndyScherzinger

@AndyScherzinger AndyScherzinger commented Sep 18, 2026 •

Copy link
Copy Markdown
Member

#6715 and #6694 have both merged, so this branch now targets master and can be reviewed on its own.

Two things in the chat reported the wrong outcome, and both sat behind the last RxJava subscriptions in ChatViewModel that still used the disposableSet the chat throws away on pause.

refactor(chat): move reminders and sharing to notes off RxJava — setReminder, getReminder, deleteReminder, shareToNotes and shareLocationToNotes move down through ChatNetworkDataSource and RetrofitChatNetwork onto four new NcApiCoroutines endpoints. This is not the pure refactor it looks like: disposableSet is disposed in onPause, not in onCleared, so backgrounding the chat while one of these requests was in flight cancelled it silently. On viewModelScope they finish.

getCapabilities, joinRoom and createRoom stay on RxJava on purpose. They sit in that same disposableSet, so moving them is the same behaviour change — and for a join or a capability fetch, what should happen when the chat is backgrounded mid-request is a decision, not a refactor. Neither blocks anything.

fix(chat): tell the user when a reminder or a share to notes failed — a reminder the server refused was written to the log and nowhere else. And showSnackBar fires "Message sent" the moment a share to notes is started, before the answer arrives, so a share that failed was reported to the user as a success. Both now report the failure, through the SharedFlow and snackbar shape #6694 established for reaction failures.

A share that failed for a transient reason is retried, but never blindly. Talk stores a message's referenceId and never looks at it again — verified against a Nextcloud 36 dev instance with Talk main: posting twice with the same reference id returns 201 twice and leaves two messages in the room. So before a second attempt the client asks the note to self whether the message arrived anyway, and only sends it again when it did not. A lookup that cannot be answered counts as "it may be there", because a duplicate note is worse than a missing retry. The location share now carries a reference id too, which the share endpoint has always accepted.

Deliberately without an optimistic reminder state, although the implementation plan asked for one: getReminderExistState has exactly one consumer, the reminder dialog header, and DateTimeCompose refetches the reminder in its constructor every time that dialog opens, while Set and Delete dismiss it immediately. An optimistic value would never be rendered.

🖼️ Screenshots

No UI was added or changed. One new string, nc_message_not_added_to_notes, shown in the existing chat snackbar.

🏁 Checklist

  • ⛑️ Tests (unit and/or integration) are included or not needed — four tests cover holdsShare, the rule that decides whether a failed share is sent again. ChatViewModel takes 14 constructor dependencies plus sharedApplication, so there is no view-model-level test for the snackbar itself; the helper contract these paths rely on is covered in Put every optimistic action on one helper and fix the ones that failed silently #6715
  • 🔖 Capability is checked or not needed
  • 🔙 Backport requests are created or not needed — not backported, this goes into 25.1.0
  • 📅 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

Summary by CodeRabbit

  • Bug Fixes
    • Improved the reliability of sharing messages and locations to Notes, helping prevent duplicate shares when a request fails temporarily.
    • Chat now displays an error message when a reminder or Notes-sharing action fails.

@AndyScherzinger
AndyScherzinger force-pushed the feat/noid/optimisticReminders branch 2 times, most recently from 1cff49c to 93bea38 Compare September 18, 2026 07:38
@AndyScherzinger AndyScherzinger added this to the 25.1.0 milestone Sep 18, 2026
@AndyScherzinger
AndyScherzinger force-pushed the feat/noid/optimisticConversationActions branch from 5099081 to f8ce16e Compare September 24, 2026 14:24
@AndyScherzinger
AndyScherzinger force-pushed the feat/noid/optimisticReminders branch from 93bea38 to 0e97e99 Compare September 24, 2026 14:27
@AndyScherzinger
AndyScherzinger force-pushed the feat/noid/optimisticConversationActions branch from f8ce16e to 36e1a8e Compare September 24, 2026 15:01
@AndyScherzinger
AndyScherzinger force-pushed the feat/noid/optimisticReminders branch from 0e97e99 to 0f19149 Compare September 24, 2026 15:01
@AndyScherzinger
AndyScherzinger force-pushed the feat/noid/optimisticConversationActions branch from 36e1a8e to ba3d4b7 Compare September 24, 2026 16:32
@AndyScherzinger
AndyScherzinger force-pushed the feat/noid/optimisticReminders branch from 0f19149 to bf571a9 Compare September 24, 2026 16:41
@AndyScherzinger
AndyScherzinger force-pushed the feat/noid/optimisticConversationActions branch from ba3d4b7 to ca9e10d Compare October 1, 2026 18:59
@AndyScherzinger
AndyScherzinger force-pushed the feat/noid/optimisticReminders branch from bf571a9 to a0740e5 Compare October 1, 2026 19:02
@AndyScherzinger
AndyScherzinger force-pushed the feat/noid/optimisticConversationActions branch 2 times, most recently from 75b1f11 to fdb65eb Compare October 2, 2026 16:55
@AndyScherzinger
AndyScherzinger force-pushed the feat/noid/optimisticReminders branch from a0740e5 to 08df497 Compare October 2, 2026 16:57
@AndyScherzinger
AndyScherzinger force-pushed the feat/noid/optimisticConversationActions branch from fdb65eb to 4db6b67 Compare October 5, 2026 22:29
@AndyScherzinger
AndyScherzinger force-pushed the feat/noid/optimisticReminders branch from 08df497 to 00d3a61 Compare October 5, 2026 22:32
@AndyScherzinger
AndyScherzinger force-pushed the feat/noid/optimisticConversationActions branch from 4db6b67 to 77b4de6 Compare October 5, 2026 23:20
@AndyScherzinger
AndyScherzinger force-pushed the feat/noid/optimisticReminders branch from 00d3a61 to 8200d2c Compare October 5, 2026 23:20
@AndyScherzinger
AndyScherzinger force-pushed the feat/noid/optimisticConversationActions branch from 77b4de6 to 24c3354 Compare October 5, 2026 23:45
@AndyScherzinger
AndyScherzinger force-pushed the feat/noid/optimisticReminders branch from 8200d2c to 57e7e04 Compare October 5, 2026 23:48
@AndyScherzinger
AndyScherzinger force-pushed the feat/noid/optimisticConversationActions branch from 24c3354 to 007ce89 Compare October 6, 2026 05:48
@AndyScherzinger
AndyScherzinger force-pushed the feat/noid/optimisticReminders branch from 57e7e04 to 2fb50b7 Compare October 6, 2026 05:50
@AndyScherzinger
AndyScherzinger force-pushed the feat/noid/optimisticConversationActions branch from 007ce89 to 18a84d3 Compare October 6, 2026 08:56
@AndyScherzinger
AndyScherzinger force-pushed the feat/noid/optimisticReminders branch from 2fb50b7 to 85883e2 Compare October 6, 2026 08:59
@AndyScherzinger
AndyScherzinger force-pushed the feat/noid/optimisticConversationActions branch from 18a84d3 to 43377cb Compare October 10, 2026 16:03
@AndyScherzinger
AndyScherzinger force-pushed the feat/noid/optimisticReminders branch from 85883e2 to c7fd3fb Compare October 10, 2026 16:05

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fbe4d5e8-5473-4715-bd02-27cbbd313487
📥 Commits

Reviewing files that changed from the base of the PR and between 43377cb and c7fd3fb.

📒 Files selected for processing (7)
  • app/src/main/java/com/nextcloud/talk/api/NcApiCoroutines.kt
  • app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt
  • app/src/main/java/com/nextcloud/talk/chat/data/network/ChatNetworkDataSource.kt
  • app/src/main/java/com/nextcloud/talk/chat/data/network/RetrofitChatNetwork.kt
  • app/src/main/java/com/nextcloud/talk/chat/viewmodels/ChatViewModel.kt
  • app/src/main/res/values/strings.xml
  • app/src/test/java/com/nextcloud/talk/chat/viewmodels/ChatViewModelTest.kt

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review.

Comment thread app/src/main/java/com/nextcloud/talk/chat/viewmodels/ChatViewModel.kt Outdated
Comment thread app/src/main/java/com/nextcloud/talk/chat/viewmodels/ChatViewModel.kt Outdated
@AndyScherzinger
AndyScherzinger force-pushed the feat/noid/optimisticConversationActions branch from 43377cb to a238355 Compare October 11, 2026 09:14
@AndyScherzinger
AndyScherzinger force-pushed the feat/noid/optimisticReminders branch from c7fd3fb to dcc3a79 Compare October 11, 2026 09:14
@mahibi
mahibi force-pushed the feat/noid/optimisticConversationActions branch from a238355 to 09db8f2 Compare October 12, 2026 13:42
@AndyScherzinger
AndyScherzinger force-pushed the feat/noid/optimisticConversationActions branch 2 times, most recently from c43e42d to d440ed1 Compare October 14, 2026 15:46
@AndyScherzinger
AndyScherzinger force-pushed the feat/noid/optimisticReminders branch from dcc3a79 to 415f322 Compare October 14, 2026 15:46
Base automatically changed from feat/noid/optimisticConversationActions to master October 15, 2026 09:20
@AndyScherzinger
AndyScherzinger force-pushed the feat/noid/optimisticReminders branch from 415f322 to 465d034 Compare October 15, 2026 11:00
@AndyScherzinger
AndyScherzinger marked this pull request as ready for review October 15, 2026 11:12
@AndyScherzinger

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository: nextcloud/talk-android/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 1210353a-2465-43e6-b090-e4286203f6ca
📥 Commits

Reviewing files that changed from the base of the PR and between c7fd3fb and 465d034.

📒 Files selected for processing: 2
  • app/src/main/java/com/nextcloud/talk/chat/viewmodels/ChatViewModel.kt
  • app/src/main/res/values/strings.xml

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

Comment thread app/src/main/java/com/nextcloud/talk/chat/viewmodels/ChatViewModel.kt Outdated
@AndyScherzinger
AndyScherzinger force-pushed the feat/noid/optimisticReminders branch from 465d034 to 3d8dd2a Compare October 15, 2026 11:48
@AndyScherzinger AndyScherzinger added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Oct 15, 2026
@AndyScherzinger
AndyScherzinger force-pushed the feat/noid/optimisticReminders branch 5 times, most recently from c6db06c to 6840143 Compare October 16, 2026 11:28
AndyScherzinger and others added 3 commits October 16, 2026 13:51
Both used an Observable with a disposable that the chat throws away when it
is paused, so backgrounding the app while the request was in flight dropped
it silently. They now run in the view model scope like every other request
that has to finish.

Assisted-by: Claude Code:claude-opus-5
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
A reminder the server refused was only logged, and the chat says "Message
sent" the moment a share to notes starts, before the answer arrives - so a
share that failed was reported as a success. Both now show what happened.

Assisted-by: Claude Code:claude-opus-5
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
@mahibi
mahibi force-pushed the feat/noid/optimisticReminders branch from 6840143 to aa0d8cc Compare October 16, 2026 12:12
@mahibi
mahibi self-requested a review October 16, 2026 12:12
@github-actions

Copy link
Copy Markdown
Contributor

📱 QA build

Download app-qa-debug.apk
QR code Open the QR code for this download
Commit aa0d8cc
Version 6717
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.

@AndyScherzinger
AndyScherzinger merged commit 6065e86 into master Oct 17, 2026
16 of 21 checks passed
@AndyScherzinger
AndyScherzinger deleted the feat/noid/optimisticReminders branch October 17, 2026 08:44
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.

2 participants