talk-android icon indicating copy to clipboard operation
talk-android copied to clipboard

Show a temporary messages when sending and keep it on error

Open nickvergessen opened this issue 4 years ago • 6 comments

Success (bonus weird scrolling) Error case (with copy/paste option)
Peek 2021-05-17 12-00 Peek 2021-05-17 12-01

I have no clue why the scrolling freaks out like this.

Code changes to help testing

Modify your Talk install to make the response slower:

diff --git a/lib/Controller/ChatController.php b/lib/Controller/ChatController.php
index f8e0f19a6..e71bd1d81 100644
--- a/lib/Controller/ChatController.php
+++ b/lib/Controller/ChatController.php
@@ -226,6 +226,7 @@ class ChatController extends AEnvironmentAwareController {
         *         found".
         */
        public function sendMessage(string $message, string $actorDisplayName = '', string $referenceId = '', int $replyTo = 0): DataResponse {
+               sleep(1);
                [$actorType, $actorId] = $this->getActorInfo($actorDisplayName);
                if (!$actorId) {
                        return new DataResponse([], Http::STATUS_NOT_FOUND);

And use the follow change to create a slow error

diff --git a/lib/Controller/ChatController.php b/lib/Controller/ChatController.php
index f8e0f19a6..e71bd1d81 100644
--- a/lib/Controller/ChatController.php
+++ b/lib/Controller/ChatController.php
@@ -226,6 +226,8 @@ class ChatController extends AEnvironmentAwareController {
         *         found".
         */
        public function sendMessage(string $message, string $actorDisplayName = '', string $referenceId = '', int $replyTo = 0): DataResponse {
+               sleep(1);
+               return new DataResponse([], Http::STATUS_BAD_REQUEST);
                [$actorType, $actorId] = $this->getActorInfo($actorDisplayName);
                if (!$actorId) {
                        return new DataResponse([], Http::STATUS_NOT_FOUND);

Follow up todos

  • [ ] Fix scrolling (I have no idea where it goes wild)
  • [ ] Messages can have a reference id which should be set and the temporary messages only be removed by the fetching of messages when there is a reference id match.

Fix #838

nickvergessen avatar May 17 '21 10:05 nickvergessen

wow that's on old one. i now rebased on master but didn't have a closer look what needs to be done here

mahibi avatar May 17 '22 09:05 mahibi

Lint

TypemasterPR
Warnings116116
Errors11

SpotBugs (new)

Warning Type Number
Bad practice Warnings 8
Correctness Warnings 35
Experimental Warnings 2
Internationalization Warnings 9
Malicious code vulnerability Warnings 23
Performance Warnings 22
Security Warnings 2
Dodgy code Warnings 65
Total 166

SpotBugs (master)

Warning Type Number
Bad practice Warnings 8
Correctness Warnings 35
Experimental Warnings 2
Internationalization Warnings 9
Malicious code vulnerability Warnings 23
Performance Warnings 22
Security Warnings 2
Dodgy code Warnings 65
Total 166

nextcloud-android-bot avatar Jul 06 '22 20:07 nextcloud-android-bot

/rebase

AndyScherzinger avatar Jul 28 '22 22:07 AndyScherzinger

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/1259-talk.apk

qrcode

To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud Talk app.

github-actions[bot] avatar Jul 28 '22 22:07 github-actions[bot]

/rebase

AndyScherzinger avatar Jan 08 '23 20:01 AndyScherzinger

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/1259-talk.apk

qrcode

To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud Talk app.

github-actions[bot] avatar Jan 08 '23 20:01 github-actions[bot]

Codacy

Lint

TypemasterPR
Warnings109109
Errors00

SpotBugs

CategoryBaseNew
Correctness1212
Dodgy code173173
Internationalization55
Malicious code vulnerability33
Performance99
Security22
Total204204

github-actions[bot] avatar Jan 08 '23 20:01 github-actions[bot]

wow that's on old one. i now rebased on master but didn't have a closer look what needs to be done here

Any chance this makes it at some point? :)

nickvergessen avatar Dec 15 '23 06:12 nickvergessen