Repository navigation
Report the outcome of reminders and shares to notes instead of guessing it - #6717
AndyScherzinger wants to merge 3 commits into
Conversation
1cff49c to
93bea38
Compare
5099081 to
f8ce16e
Compare
93bea38 to
0e97e99
Compare
f8ce16e to
36e1a8e
Compare
0e97e99 to
0f19149
Compare
36e1a8e to
ba3d4b7
Compare
0f19149 to
bf571a9
Compare
ba3d4b7 to
ca9e10d
Compare
bf571a9 to
a0740e5
Compare
75b1f11 to
fdb65eb
Compare
a0740e5 to
08df497
Compare
fdb65eb to
4db6b67
Compare
08df497 to
00d3a61
Compare
4db6b67 to
77b4de6
Compare
00d3a61 to
8200d2c
Compare
77b4de6 to
24c3354
Compare
8200d2c to
57e7e04
Compare
24c3354 to
007ce89
Compare
57e7e04 to
2fb50b7
Compare
007ce89 to
18a84d3
Compare
2fb50b7 to
85883e2
Compare
18a84d3 to
43377cb
Compare
85883e2 to
c7fd3fb
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
📝 Walkthrough
Merge Risk: 🟡 Moderate · up to
|
There was a problem hiding this comment.
Actionable comments posted: 3
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Organization UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
fbe4d5e8-5473-4715-bd02-27cbbd313487
📒 Files selected for processing (7)
app/src/main/java/com/nextcloud/talk/api/NcApiCoroutines.ktapp/src/main/java/com/nextcloud/talk/chat/ChatActivity.ktapp/src/main/java/com/nextcloud/talk/chat/data/network/ChatNetworkDataSource.ktapp/src/main/java/com/nextcloud/talk/chat/data/network/RetrofitChatNetwork.ktapp/src/main/java/com/nextcloud/talk/chat/viewmodels/ChatViewModel.ktapp/src/main/res/values/strings.xmlapp/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.
43377cb to
a238355
Compare
c7fd3fb to
dcc3a79
Compare
a238355 to
09db8f2
Compare
c43e42d to
d440ed1
Compare
dcc3a79 to
415f322
Compare
415f322 to
465d034
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
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
📒 Files selected for processing: 2
app/src/main/java/com/nextcloud/talk/chat/viewmodels/ChatViewModel.ktapp/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.
465d034 to
3d8dd2a
Compare
c6db06c to
6840143
Compare
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>
6840143 to
aa0d8cc
Compare
#6715 and #6694 have both merged, so this branch now targets
masterand can be reviewed on its own.Two things in the chat reported the wrong outcome, and both sat behind the last RxJava subscriptions in
ChatViewModelthat still used thedisposableSetthe chat throws away on pause.refactor(chat): move reminders and sharing to notes off RxJava—setReminder,getReminder,deleteReminder,shareToNotesandshareLocationToNotesmove down throughChatNetworkDataSourceandRetrofitChatNetworkonto four newNcApiCoroutinesendpoints. This is not the pure refactor it looks like:disposableSetis disposed inonPause, not inonCleared, so backgrounding the chat while one of these requests was in flight cancelled it silently. OnviewModelScopethey finish.getCapabilities,joinRoomandcreateRoomstay on RxJava on purpose. They sit in that samedisposableSet, 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. AndshowSnackBarfires "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 theSharedFlowand 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
referenceIdand never looks at it again — verified against a Nextcloud 36 dev instance with Talkmain: posting twice with the same reference id returns201twice 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 theshareendpoint has always accepted.Deliberately without an optimistic reminder state, although the implementation plan asked for one:
getReminderExistStatehas exactly one consumer, the reminder dialog header, andDateTimeComposerefetches 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
holdsShare, the rule that decides whether a failed share is sent again.ChatViewModeltakes 14 constructor dependencies plussharedApplication, 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🤖 AI (if applicable)
Summary by CodeRabbit