nextcloud / talk-ios

📱😀 Video & audio calls through Nextcloud on iOS
GNU General Public License v3.0
146 stars 86 forks source link

Message doesn't show in chat when sending in Airplane Mode until re-entering chat #1669

Closed egigoka closed 1 month ago

egigoka commented 1 month ago

Steps to reproduce

  1. Enable Airplane Mode
  2. Open Nextcloud Talk
  3. Open a chat
  4. Write a message and tap the send icon
  5. No message appears in the chat
  6. Go back to the list of all chats
  7. Open the chat where previously you sent the message
  8. The message appears

Expected behaviour

The message should appear after step 4 when you tap send

Actual behaviour

The message appears only on step 7, when you re-open the chat

Device information

Device: iPhone 11 Pro Max

iOS version: 17.5.1

Talk version: 19.0.2

Server information

Nextcloud version: 29.0.0 (latest Docker image)

Talk version: 19.0.1

Custom Signaling server configured: no

Custom TURN server configured: no

Custom STUN server configured: no, only stun.nextcloud.com:443

Server log (data/nextcloud.log)

rotated log before re-running str ``` {"reqId":"saVIptzjbtr36UqSzNU6","level":3,"time":"2024-05-24T12:22:36+00:00","remoteAddr":"","user":"","app":"PHP","method":"GET","url":"/ocs/v2.php/apps/spreed/api/v4/room?includeStatus=true","message":"Optional parameter $userId declared before required parameter $path is implicitly treated as a required parameter at /var/www/html/custom_apps/deck/lib/Service/ConfigService.php#234","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0","version":"29.0.0.19","data":{"app":"PHP"} ```
SystemKeeper commented 1 month ago

Can't reproduce it on my end:

https://github.com/nextcloud/talk-ios/assets/1580193/33a5fea0-2e09-4e56-91b0-27ec1f587e3f

Anything I did miss? Also can you please provide a screenshot from Settings -> Diagnostics -> Capabilities (first page is fine, should start with "audio")

egigoka commented 1 month ago

Video with reproduction:

https://github.com/nextcloud/talk-ios/assets/23525323/8fa97d8d-5c45-4822-af0d-18739adcd1c8

Capabilities first page:

Full Capabilities:

Full Diagnostics:

SystemKeeper commented 1 month ago

Your problem is the missing chat-reference-id capability. That column was first added with Nextcloud 13 (https://github.com/nextcloud/server/blob/ae4a6e8d4454b7896d0e40f367096a26d999dbf0/core/Migrations/Version13000Date20170718121200.php#L860) and was also added to a migration in 29 (https://github.com/nextcloud/server/blob/ae4a6e8d4454b7896d0e40f367096a26d999dbf0/core/Migrations/Version29000Date20231213104850.php#L51).

There are 2 options here:

egigoka commented 1 month ago
MariaDB [db_name]> SHOW COLUMNS FROM oc_comments LIKE 'reference_id';
+--------------+-------------+------+-----+---------+-------+
| Field        | Type        | Null | Key | Default | Extra |
+--------------+-------------+------+-----+---------+-------+
| reference_id | varchar(64) | YES  |     | NULL    |       |
+--------------+-------------+------+-----+---------+-------+
1 row in set (0.002 sec)

column is there

  1. also I've run sudo -u www-data php occ maintenance:repair
Warning: Failed to set memory limit to 0 bytes (Current memory u
The current PHP memory limit is below the recommended value of 5
 - Repair MySQL collation
     - All tables already have the correct collation -> nothing
 - Repair mime types
 - Clean tags and favorites
     - 0 tags of deleted users have been removed.
     - 0 tags for delete files have been removed.
     - 0 tag entries for deleted tags have been removed.
     - 0 tags with no entries have been removed.
 - Repair invalid shares
 - Move .step file of updater to backup location
 - Add move avatar background job
     - Add background job
 - Add preview cleanup background jobs
 - Migrate oauth2_clients table to nextcloud schema
     - Update the oauth2_access_tokens table schema.
     - Update the oauth2_clients table schema.
     - Delete clients (and their related access tokens) with the
 - Fix potential broken mount points
     - No mounts updated
 - Repair language codes
 - Add log rotate job
 - Clear frontend caches
     - Image cache cleared
     - JS cache cleared
 - Clear every generated avatar
 - Add preview background cleanup job
 - Queue a one-time job to cleanup old backups of the updater
 - Cleanup invalid photocache files for carddav
 - Add background job to cleanup login flow v2 tokens
 - Remove potentially over exposing share links
     - No need to remove link shares.
 - Clear access cache of projects
 - Reset generated avatar flag
 - Keep legacy encryption enabled
 - Check encryption key format
 - Remove old dashboard app config data
 - Add job to cleanup the bruteforce entries
 - Queue a one-time job to check for user uploaded certificates
 - Repair DAV shares
 - Add background job to set the lookup server share state for u
 - Add token cleanup job
 - Clean up abandoned apps
 - Add possibly missing system config
 - Add AI tasks cleanup job
 - Queue a job to generate metadata
 - migrate lazy config values
 - Upgrading Circles App
 - Fix component of birthday calendars
     - 1 birthday calendars updated.
 - Regenerating birthday calendars to use new icons and fix old
     - Adding background jobs to regenerate birthday calendar
 - Fix broken values of calendar objects
    0 [->--------------------------]
 - Registering building of calendar search index as background j
     - Add background job
 - Register building of social profile search index as backgroun
     - Add background job
 - Registering background jobs to update cache for webcal calend
     - Added 0 background jobs to update webcal calendars
 - Registering building of calendar reminder index as background
     - Add background job
 - Clean up orphan event and contact data
     - 0 events without a calendar have been cleaned up
     - 0 properties without an events have been cleaned up
     - 0 changes without a calendar have been cleaned up
     - 0 cached events without a calendar subscription have been cleaned up
     - 0 changes without a calendar subscription have been cleaned up
     - 0 contacts without an addressbook have been cleaned up
     - 0 properties without a contact have been cleaned up
     - 0 changes without an addressbook have been cleaned up
 - Remove activity entries of private events
     - Removed 0 activity entries
 - Clean up old calendar subscriptions from deleted users that were not cleaned-up
    0 [----->----------------------]
     - 0 calendar subscriptions without an user have been cleaned up
 - Remove invalid object properties
     - 0 invalid object properties removed.
 - Fix the share type of guest shares when migrating from ownCloud
 - Copy the share password into the dedicated column
 - Set existing shares as accepted
 - Restore default tags that are missing
     - Looking up default tags
     - 0 accounts to check found
    0 [--------->------------------]
 - Add a generated message-id to all Mail messages that have none
     - Looking up messages without a message-id
 - Purify and migrate collected mail addresses
    0 [------------->--------------]
 - Insert background jobs for all accounts
    0 [---------------->-----------]
 - Make Mail itinerary extractor executable
     - itinerary file doesn't exist
 - Create or update provisioned Mail accounts
     - 0 accounts provisioned
 - Repair Broken Threads for all mail accounts
     - Repaired threads, 0 messages updated
 - Clean up meta table
 - Show a hint about the new editor to existing users
 - Update OAuth token expiration times
 - init metadata
 - Create help command
 - Invalidate access cache for projects conversation provider
     - Invalidation not required
 - Cache the user display names
 - Switches from default updater server to the customer one if a valid subscription is available
 - Send an admin notification if monthly report is disabled
 - Force-reset all Text sessions before Yjs migration
 - Initialize migration of background images from dashboard to theming app
 - Add background job to check for backup codes
 - Populating added database structures for workflows

  1. restarted server
  2. relogin in iOS app

still no chat-reference-id in Capabilities

Should I move to backend issues?

SystemKeeper commented 1 month ago

The background job gets removed when it is run successfully. Still it seems that the the app config is not there. Can you execute the following queries please:

SELECT * FROM `oc_jobs` WHERE class LIKE '%CheckReferenceIdColumn%';

SELECT * FROM `oc_appconfig` WHERE configkey = 'has_reference_id'
egigoka commented 1 month ago

no problem, can do

SELECT * FROM `oc_jobs` WHERE class LIKE '%CheckReferenceIdColumn%';
+----+-----------------------------------------------+----------+----------+--------------+-------------+--------------------+----------------------------------+----------------+
| id | class                                         | argument | last_run | last_checked | reserved_at | execution_duration | argument_hash                    | time_sensitive |
+----+-----------------------------------------------+----------+----------+--------------+-------------+--------------------+----------------------------------+----------------+
| 93 | OCA\Talk\BackgroundJob\CheckReferenceIdColumn | null     |        0 |   1716550435 |           0 |                  0 | 37a6259cc0c1dae299a7866489dff0bd |              1 |
+----+-----------------------------------------------+----------+----------+--------------+-------------+--------------------+----------------------------------+----------------+
1 row in set (0.001 sec)
SELECT * FROM `oc_appconfig` WHERE configkey = 'has_reference_id';
Empty set (0.001 sec)
SystemKeeper commented 1 month ago

Hm, the job never ran, but is also marked as time sensitive, although it should be insensitive. Background jobs working correctly for you, right? Can you post a screenshot of the background jobs section in the admin settings: /settings/admin?

If you wanna manually run the job, you can do with occ background-job:execute 93.

SystemKeeper commented 1 month ago

Did it work for you? Can we close the issue?

egigoka commented 1 month ago

image

Should I change to cron?

I've run job manually:

/var/www/html# sudo -u www-data php occ background-job:execute 93

Warning: Failed to set memory limit to 0 bytes (Current memory usage is 2097152 bytes) in Unknown on line 0
The current PHP memory limit is below the recommended value of 512MB.
Job class:            OCA\Talk\BackgroundJob\CheckReferenceIdColumn
Arguments:            null
Type:                 timed

Last checked:         2024-05-24T11:33:55+00:00
Reserved at:          -
Last executed:        1970-01-01T00:00:00+00:00
Last duration:        0
Next execution:       1970-01-01T01:00:00+00:00

Job executed!

Restarted iOS app, and chat-reference-id is in Capabilities!

Sorry for the delay, I'm not in the best of state.

SystemKeeper commented 1 month ago

The issue is that the background jobs are not correctly working for you (see the warning). Thanks for the info, I'll close the issue then.