nerzhul / ncsms-android

repository for the ncsms on Android
95 stars 38 forks source link

sync from different phones deletes previously synced messages on server #229

Open mjhlan opened 4 years ago

mjhlan commented 4 years ago

hey,

I just started out with ocsms/nextcloud SMS and ran into some behaviour I didn't expect for a "one way sync" -- so this might just be on me...

I wanted to sync sms from three different phones (my current one, and two older ones, no longer in use), all to the same account in nextcloud, Syncing/uploading messages from the first two phones seemed to work fine, uploading from the oldest one (partially) deleted messages on the server, I had already uploaded.

phone1 (android 9) is currently in use, phone2 (android 8) was an intermediate one, phone3 (android 6) is the oldest. I used them consecutively and didn't previously transfer sms from one to the other, so there are no doubles/same messages on more than one phone.

Order of my steps

  1. Sync SMS from phone1 to server
  2. Sync SMS from phone2 to server
  3. Sync SMS from phone3 to server

Expected behaviour

SMS to the same number are grouped together in one long chat history on the server.

Actual behaviour

Sync from phone1 to server was successful, (presumably all) messages were displayed in the server's web interface. Sync from phone2 to server was also successful, messages from phone2 were appended (or pre-pended...) to the messages from phone1 in the server's web interface. Sync from phone3 (the oldest) uploaded the messages only partially (meaning not all messages from phone3 are visible on server) and deleted the previously synced messages from phone1 and phone2 on the server in the respective chats (meaning, if messages to/from contact_xyz already existed on the server, the sync from phone3 removed these messages and replaced them with only the messages from phone3).

Syncing again from phone1 appends the messages to the messages from phone3 correctly.

Baseline: syncing older messages from one phone deleted newer messages from another phone.

Server configuration

Nextcloud version: 18.0.3

PHP version: 7.3.14

Webserver:

HTTPS:

Client configuration

Android version: 9, 8, 6

Phone: Moto G2, Moto G5, Huawei P20 Pro

Nextcloud SMS app version: 2.0.5

Logs

didn't find error messages related to ocSMS in the nextcloud log so far...