Skip to content

Problem with Push Notification on android  #497

@NemosNew

Description

@NemosNew

Steps to reproduce

  1. Start group chat with two users.
  2. Write test message from one user

Expected behaviour
Push notification on android phone.

Actual behaviour
No push notification at all (before message in group chat, there was).

Server configuration

Operating system: Gentoo amd64
Web server: Apache 2.4.41
Database: mariadb 10.4.10
PHP version: php 7.2.24
Nextcloud version: Nextcloud 17.0.1

fresh install from gentoo repo.

List of activated apps:

Enabled:

  • accessibility: 1.3.0
  • activity: 2.10.1
  • bruteforcesettings: 1.4.0
  • cloud_federation_api: 1.0.0
  • comments: 1.7.0
  • dav: 1.13.0
  • federatedfilesharing: 1.7.0
  • files: 1.12.0
  • files_external: 1.8.0
  • files_pdfviewer: 1.6.0
  • files_rightclick: 0.15.1
  • files_sharing: 1.9.0
  • files_trashbin: 1.7.0
  • files_versions: 1.10.0
  • files_videoplayer: 1.6.0
  • firstrunwizard: 2.6.0
  • gallery: 18.4.0
  • logreader: 2.2.0
  • lookup_server_connector: 1.5.0
  • nextcloud_announcements: 1.6.0
  • notifications: 2.5.0
  • oauth2: 1.5.0
  • password_policy: 1.7.0
  • privacy: 1.1.0
  • provisioning_api: 1.7.0
  • recommendations: 0.5.0
  • serverinfo: 1.7.0
  • spreed: 7.0.2
  • survey_client: 1.5.0
  • text: 1.1.1
  • theming: 1.8.0
  • twofactor_backupcodes: 1.6.0
  • updatenotification: 1.7.0
  • user_ldap: 1.7.0
  • viewer: 1.2.0
  • workflowengine: 1.7.0

Nextcloud configuration:

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "***REMOVED SENSITIVE VALUE***",
            "***REMOVED SENSITIVE VALUE***"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "17.0.1.1",
        "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "maintenance": false,
        "ldapIgnoreNamingRules": false,
        "ldapProviderFactory": "OCA\\User_LDAP\\LDAPProviderFactory",
        "mail_smtpmode": "sendmail",
        "logfile": "\/mnt\/data\/apache2_data\/nextcloud\/htdocs\/nnn_cloud_chat\/data\/nextcloud.log",
        "log_rotate_size": 104857600,
        "default_language": "ru",
        "default_locale": "ru_RU",
        "defaultapp": "spreed",
        "skeletondirectory": "\/mnt\/data\/apache2_data\/nextcloud\/htdocs\/nnn_cloud_chat\/core\/skeleton_empty"
    }
}

Client configuration

Android 7.0
Nextcloud Talk v7.0.8

Logs

Nextcloud log

[notifications] Fatal: error:0909006C:PEM routines:get_name:no start line

POST /<nextcloud_root>/ocs/v2.php/apps/spreed/api/v1/chat/rk3doban
from *.*.*.* by admin at 2019-12-02T11:04:36+00:100:

I make a little research (from other similar issue).
Problem is in lib/Push.php, there are protection for too long $data:

// Max length of encryption is 255, so we need to shorten the subject to be shorter
$subject = $notification->getParsedSubject();
$dataLength = 245 - strlen(json_encode($data));
if (strlen($subject) > $dataLength) {
	$data['subject'] = substr($subject, 0, $dataLength) . '…';
} else {
	$data['subject'] = $subject;
}

In my case when sending message in group chat strlen(json_encode($data)) is 275.
As I understand limitation on data length come from openssl_public_encrypt()
I can be wrong, but this problem can be solved if do as all block cipher do - devided big data into small blocks and encrypt them separately.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions