nextcloud / text

đŸ“‘ Collaborative document editing using Markdown
GNU Affero General Public License v3.0
530 stars 86 forks source link

Crash after attempting to edit conflicted markdown file #1784

Closed eniad closed 1 year ago

eniad commented 3 years ago

Steps to reproduce

  1. Have Nextcloud Android and Windows clients on separate devices
  2. Edit markdown file in Android client
  3. Edit file on Windows (I am using the Windows client, but editing files directly)
  4. Open file on Android
  5. Crash

These edits were several hours apart, so there should have been enough time for the changes to propagate between both clients and the server.

The markdown file in question is used by the Pico CMS plugin for Nextcloud. This has happened on other files. In fact, it's pretty common for this conflict to crash my Android client (~weekly).

Expected behaviour

The Android client should either:
A. Allow resolution of conflicts without crashing
B. Prevent conflicts by updating local copy to saved (on server)

Actual behaviour

Conflicts cause several problems:

  1. Crash before conflict resolution (as in this bug report)
  2. Conflict resolution interaction that does not actually resolve when the saved file is selected (see comment on this bug report)
  3. Crash after conflict resolution in 2 is tried.

Can you reproduce this problem on https://try.nextcloud.com?

No. I'm not sure how to emulate two clients and the server, but I did play around with it.

Environment data

Android version: 9

Device model: moto g6

Stock or customized system: Stock

Nextcloud app version: 30160190

Nextcloud server version: 20.0.11

Reverse proxy: No

Logs

Web server error log

Not 100% sure this web server log is related, but the timing and file path coincide.

[PHP] Error: Error: Undefined index: purpose at /var/www/html/custom_apps/cms_pico/appdata_public/plugins/LWpcgY12Fw/pico_categories_page/pico_categories_page.php#20 at <<closure>>

 0. /var/www/html/custom_apps/cms_pico/appdata_public/plugins/LWpcgY12Fw/pico_categories_page/pico_categories_page.php line 20
    OC\Log\ErrorHandler::onError(8, "Undefined index: purpose", "/var/www/html/c ... p", 20, {pageData: {0: " ... }})
 1. /var/www/html/custom_apps/cms_pico/vendor/picocms/pico/lib/AbstractPicoPlugin.php line 101
    pico_categories_page->onSinglePageLoaded({0: "And 7 more  ... "})
 2. /var/www/html/custom_apps/cms_pico/vendor/picocms/pico/lib/Pico.php line 2788
    AbstractPicoPlugin->handleEvent("onSinglePageLoaded", [{0: "And 7 more ... }])
 3. /var/www/html/custom_apps/cms_pico/vendor/picocms/pico/lib/Pico.php line 1794
    Pico->triggerEvent("onSinglePageLoaded", [{0: "And 7 more ... }])
 4. /var/www/html/custom_apps/cms_pico/vendor/picocms/pico/lib/Pico.php line 493
    Pico->readPages()
 5. /var/www/html/custom_apps/cms_pico/lib/Pico.php line 108
    Pico->run()
 6. /var/www/html/custom_apps/cms_pico/lib/Service/PicoService.php line 149
    OCA\CMSPico\Pico->run()
 7. /var/www/html/custom_apps/cms_pico/lib/Service/WebsitesService.php line 277
    OCA\CMSPico\Service\PicoService->getPage(OCA\CMSPico\Model\WebsiteRequest {})
 8. /var/www/html/custom_apps/cms_pico/lib/Controller/PicoController.php line 110
    OCA\CMSPico\Service\WebsitesService->getPage("music", "genre", null, false)
 9. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 169
    OCA\CMSPico\Controller\PicoController->getPage("music", "genre", false)
10. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 100
    OC\AppFramework\Http\Dispatcher->executeController(OCA\CMSPico\Controller\PicoController {}, "getPage")
11. /var/www/html/lib/private/AppFramework/App.php line 152
    OC\AppFramework\Http\Dispatcher->dispatch(OCA\CMSPico\Controller\PicoController {}, "getPage")
12. /var/www/html/lib/private/Route/Router.php line 309
    OC\AppFramework\App::main("OCA\\CMSPico\\C ... r", "getPage", OC\AppFramework\ ... {}, {page: "genre",s ... "})
13. /var/www/html/lib/base.php line 1008
    OC\Route\Router->match("/apps/cms_pico/pico/music/genre")
14. /var/www/html/index.php line 37
    OC::handleRequest()

GET /apps/cms_pico/pico/music/genre
from 192.168.1.2 at 2021-07-21T05:28:15+00:00

Nextcloud log (data/nextcloud.log)

************ CAUSE OF ERROR ************

java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ImageView.setVisibility(int)' on a null object reference
    at com.owncloud.android.ui.activity.EditorWebView.hideLoading(EditorWebView.java:75)
    at com.owncloud.android.ui.activity.-$$Lambda$7YfaHXb6ttANEryhFmOc5vhllUM.run(Unknown Source:2)
    at android.os.Handler.handleCallback(Handler.java:873)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:215)
    at android.app.ActivityThread.main(ActivityThread.java:6939)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:870)

************ APP INFORMATION ************
ID: com.nextcloud.client
Version: 30160190
Build flavor: gplay

************ DEVICE INFORMATION ************
Brand: motorola
Device: ali
Model: moto g(6)
Id: PPS29.118-15-11-16
Product: ali

************ FIRMWARE ************
SDK: 28
Release: 9
Incremental: 3afd9

NOTE: Be super sure to remove sensitive data like passwords, note that everybody can look here! You can use the Issue Template application to prefill some of the required information: https://apps.nextcloud.com/apps/issuetemplate

eniad commented 3 years ago

The behavior is not consistent (see Actual behaviour above). Screen shots of failed conflict resolution interaction (behavior 2):

Screenshot_20210719-083646

User clicks Use saved version. Then the thinking circle appears:

Screenshot_20210719-083745

After a breif time, the thinking circle stops and the user is left on the interaction page. The conflict is not resolved.

Screenshot_20210719-083733

The user can select Use current version to successfully resolve conflicts, but that wipes out changes from the server.

tobiasKaminsky commented 3 years ago

This is within text app, redirecting.

eniad commented 3 years ago

I wasn't using the dashboard for editing, so I didn't realize the text app was used for editing in both places. After checking, sure enough, the dashboard has the same issue for the same files.

screenshot-goldstine local_8080-2021 07 25-22_53_45

However, the dashboard succeeds to Use the saved version, which also clears up the Android client.

max-nextcloud commented 1 year ago

We applied quite a few fixes to conflict handling in Nextcloud 26.0.2. They will also be included in Nextcloud 27.

I know selecting the version is working. I have not tested to see if it crashes on Android though.

Please reopen or comment if this issue is still happening to you when using a Nextcloud later than 26.0.2.