nextcloud / notes-ios

Other
22 stars 8 forks source link

[Bug]: Error in DirectEditing Manager when opening note from iOS app #38

Closed marxlaml closed 1 year ago

marxlaml commented 1 year ago

⚠️ This issue respects the following points: ⚠️

Bug description

I have opened an issue in the iOS NextcloudNotes repository here. The issue in itself, is that the note won't open in the app, however the final error happens in the DirectEditing Manager, here. It seems that the Manager checks if an editorId is present in a list of registered editors when opening a note, but the check fails and raises an exception because the list of editors seems to be empty. This error does not happen when using the offline mode, nor does it happen when using the Android app.

The issue relevant for this repository here, is whether one of the last updates broke the workflow of the iOS app. A look through the changelog did not show anything like that.

Steps to reproduce

  1. Try to open note through iOS notes app.

Expected behavior

Note opens.

Installation method

Community Docker image

Nextcloud Server version

26

Operating system

Other

PHP engine version

PHP 8.1

Web server

Nginx

Database engine version

MariaDB

Is this bug present after an update or on a fresh install?

Updated from a minor version (ex. 22.2.3 to 22.2.4)

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

Configuration report

{
    "system": {
        "memcache.local": "\\OC\\Memcache\\APCu",
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "preview_max_x": 512,
        "preview_max_y": 512,
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "password": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "***REMOVED SENSITIVE VALUE***"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "26.0.1.1",
        "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
        "overwriteprotocol": "https",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "twofactor_enforced": "false",
        "twofactor_enforced_groups": [],
        "twofactor_enforced_excluded_groups": [],
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "loglevel": 2,
        "maintenance": false,
        "updater.release.channel": "stable",
        "mail_smtpsecure": "ssl",
        "mail_smtpauthtype": "LOGIN",
        "mail_smtpauth": 1,
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "theme": "",
        "chunkSize": "8196MB"
    }
}

List of activated Apps

Enabled:
  - bruteforcesettings: 2.6.0
  - calendar: 4.4.0-alpha.2
  - cloud_federation_api: 1.9.0
  - contacts: 5.3.0-beta.1
  - dav: 1.25.0
  - federatedfilesharing: 1.16.0
  - files: 1.21.1
  - files_pdfviewer: 2.7.0
  - files_rightclick: 1.5.0
  - files_sharing: 1.18.0
  - files_trashbin: 1.16.0
  - files_versions: 1.19.1
  - firstrunwizard: 2.15.0
  - logreader: 2.11.0
  - lookup_server_connector: 1.14.0
  - notes: 4.7.2
  - notifications: 2.14.0
  - oauth2: 1.14.0
  - password_policy: 1.16.0
  - privacy: 1.10.0
  - provisioning_api: 1.16.0
  - related_resources: 1.1.0-alpha1
  - serverinfo: 1.16.0
  - settings: 1.8.0
  - sharebymail: 1.16.0
  - survey_client: 1.14.0
  - theming: 2.1.1
  - twofactor_backupcodes: 1.15.0
  - unroundedcorners: 1.0.8
  - updatenotification: 1.16.0
  - viewer: 1.10.0
  - workflowengine: 2.8.0
Disabled:
  - activity: 2.18.0 (installed 2.15.0)
  - admin_audit: 1.16.0
  - circles: 26.0.0 (installed 23.1.0)
  - comments: 1.16.0 (installed 1.13.0)
  - contactsinteraction: 1.7.0 (installed 1.4.0)
  - dashboard: 7.6.0 (installed 7.3.0)
  - encryption: 2.14.0
  - external: 5.1.0 (installed 5.1.0)
  - federation: 1.16.0 (installed 1.13.0)
  - files_external: 1.18.0 (installed 1.17.0)
  - music: 1.8.3 (installed 1.8.3)
  - nextcloud_announcements: 1.15.0 (installed 1.12.0)
  - photos: 2.2.0 (installed 2.0.1)
  - recommendations: 1.5.0 (installed 1.2.0)
  - support: 1.9.0 (installed 1.6.0)
  - suspicious_login: 4.4.0
  - systemtags: 1.16.0 (installed 1.13.0)
  - text: 3.7.2 (installed 3.4.1)
  - twofactor_totp: 8.0.0-alpha.0
  - user_ldap: 1.16.0
  - user_status: 1.6.0 (installed 1.3.1)
  - weather_status: 1.6.0 (installed 1.3.0)

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

{"reqId":"U9iEseMxAi9FeVHnie60","level":3,"time":"2023-05-26T12:38:06+00:00","remoteAddr":"***REMOVED SENSITIVE VALUE***","user":"***REMOVED SENSITIVE VALUE***","app":"files","method":"POST","url":"/ocs/v2.php/apps/files/api/v1/directEditing/open?path=/Notes&fileId=575278&editorId=text","message":"Exception when opening a file through direct editing","userAgent":"Mozilla/5.0 (iOS) NextcloudNotes/4.1.7","version":"26.0.1.1","exception":{"Exception":"RuntimeException","Message":"Editor text is unknown","Code":0,"Trace":[{"file":"/var/www/html/apps/files/lib/Controller/DirectEditingController.php","line":103,"function":"open","class":"OC\\DirectEditing\\Manager","type":"->","args":["/Notes/Shared/Test.md","text",575278]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":230,"function":"open","class":"OCA\\Files\\Controller\\DirectEditingController","type":"->","args":["/Notes","text",575278]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":137,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Files\\Controller\\DirectEditingController"],"open"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":183,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Files\\Controller\\DirectEditingController"],"open"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Files\\Controller\\DirectEditingController","open",["OC\\AppFramework\\DependencyInjection\\DIContainer"],["ocs.files.DirectEditing.open"]]},{"file":"/var/www/html/ocs/v1.php","line":64,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/ocsapp/apps/files/api/v1/directEditing/open"]},{"file":"/var/www/html/ocs/v2.php","line":23,"args":["/var/www/html/ocs/v1.php"],"function":"require_once"}],"File":"/var/www/html/lib/private/DirectEditing/Manager.php","Line":180,"message":"Exception when opening a file through direct editing","CustomMessage":"Exception when opening a file through direct editing"}}

Additional info

NextcloudNotes iOS version: 4.1.7 Server OS: Arch Linux 64-bit

juliushaertl commented 1 year ago

This sounds like a bug on the iOS app that tries to use the online editor even though it is not available (which should be exposed through capabilities)

juliushaertl commented 1 year ago

Ah just seen https://github.com/nextcloud/notes-ios/issues/37 then let me close this as a duplicate since there is nothing to do on the server side arond this.