signalapp / Signal-iOS

A private messenger for iOS.
https://signal.org
GNU Affero General Public License v3.0
10.6k stars 2.95k forks source link

Updating story recipients gets overridden #5691

Closed ghost closed 7 months ago

ghost commented 8 months ago

Bug description

Updating the "Only Share With..." recipients list for "Who Can View This Story" works but gets overridden back to its previous state after some time.

Steps to reproduce

  1. Open Signal application
  2. Go to the Stories tab
  3. Tap "My Stories"
  4. Tap "Privacy" on the top right corner
  5. Select "My Story"
  6. Modify the list of recipients in "Only Share With..."
  7. Remove a few of them
  8. Tap "Save" on the top right

Actual result: The story recipient list looks like it has been updated, the number of viewers matches. However, after some time (in my case, a few hours?) the number and the actual recipients are rolled back in their previous state.

Expected result: The recipients should be properly updated and shouldn't roll back to their previous state. It's a serious trust issue!

Screenshots

IMG_3F1A3CB5BF93-1

Device info

Device: iPhone SE 2nd generation

iOS version: 17.0.3

Signal version: 6.46.1.0

Link to debug log

Not relevant as I don't know how to trigger the bug itself.

ghost commented 8 months ago

Update: the recipient list hasn't been reverted on my iPhone yet, but it did on Signal Desktop.

Screenshot 2023-10-26 at 09 43 47

I'm a bit confused where this issue can come from? Signal Server?

ghost commented 8 months ago

And here we are, just 24 hours after changing the number of recipients from 43 to 38, the iOS application is back to 43.

IMG_691DEBDBC48F-1

ghost commented 7 months ago

For your information it's still happening. No matter if I remove recipients of my story, they get added back a few hours later. Same if I add recipients, they got removed a few hours later.

harry-signal commented 7 months ago

Hi! Sorry for the delayed response. Do you have any other linked devices besides the desktop? (e.g. do you have a linked iPad?)

ghost commented 7 months ago

Hello @harry-signal, thanks a lot for your reply!

No other devices than:

  1. An iPhone SE 2nd gen (2020), main device
  2. A MacBook Air M2 (2022), paired device
sashaweiss-signal commented 7 months ago

That's helpful, thanks! The next useful step would be to collect debug logs from both the iPhone and Desktop if you notice this happen again – without those, there's not a ton we can tell.

ghost commented 7 months ago

Hello,

That's helpful, thanks! The next useful step would be to collect debug logs from both the iPhone and Desktop if you notice this happen again – without those, there's not a ton we can tell.

Thanks for the suggestion regarding the debug logs. However, I'm a bit confused on how to do that. Last time I tried to get those from my iPhone it said there was nothing to report.

As for Desktop, I understand that:

  1. I have to enable the collection prior the thing to happen
  2. Wait for it to happen
  3. Stop the collection and get them uploaded
  4. Share them here

However, wouldn't they be polluted by a lot of useless information? Signal is my primary mean of communication and I use it a ton. :/

Thanks in advance for your feedback!

sashaweiss-signal commented 7 months ago

To collect debug logs for both iOS and Desktop you can check out these steps.

We only keep a certain amount of debug logs – they age out after a set time period or if the log file grows too large. They're generally sufficient for us to investigate issues assuming the report is relatively timely!

As a next step, I recommend enabling debug logs on both devices and leaving them enabled. Then, since this isn't an issue we can intentionally reproduce, collect the logs using the steps in the article above as soon as you notice the issue again.

Thanks in advance!

ghost commented 7 months ago

Hello,

I don't think Signal Desktop debug logs can actually be disabled. I can access them from the top bar menu:

Screenshot 2023-11-16 at 12 49 34

But then there is no particular setting, beside Save or Submit:

Screenshot 2023-11-16 at 12 50 45

However, I do enabled them on iOS:

IMG_6719

And then changed the list of my stories contact recipients:

IMG_6718

As soon as the values changes, I will submit both debug logs from iOS and Desktop here. See you soon!

ghost commented 7 months ago

Hello,

It did happened again, as usual. Please find below:

To summarize again the issue:

  1. I update the recipients of my story (removing someone for example)
  2. After some time they get added back

Thanks in advance for your work y'all. I upgraded my Signal donation to 10€ per month. 🙏🏻

cityrolr commented 7 months ago

I have the exact same problem since I changed the story privacy settings once. My setup is similar with an iOS and MacOS client. My guess is that it has something to do with the desktop client not being able to toggle between the different settings because "All Signal connections" is not clickable. I recorded a video where you can see the problem, maybe that helps to debug.

https://github.com/signalapp/Signal-iOS/assets/13933169/631c478e-bc78-4cc1-91f8-2cf821453aba

vnj0x61 commented 7 months ago

i was able to reproduce it @cityrolr. I created the Privacy Settings via iOS app and then tried to click on Linux Client All Signal Connections

Idk if this is the same bug which is described by @mthld but maybe related. Here are my logs:

app.log

{"level":50,"time":"2023-11-17T13:59:54.942Z","msg":"Top-level unhandled promise rejection: Error: Error invoking remote method 'sql-channel': Error: SqliteError: near \"?\": syntax error\n at Database.prepare ([REDACTED]/resources/app.asar/node_modules/@signalapp/better-sqlite3/lib/methods/wrappers.js:5:21)\n at [REDACTED]/resources/app.asar/ts/sql/Server.js:4394:10\n at batchMultiVarQuery ([REDACTED]/resources/app.asar/ts/sql/util.js:152:18)\n at modifyStoryDistributionMembersSync ([REDACTED]/resources/app.asar/ts/sql/Server.js:4385:38)\n at [REDACTED]/resources/app.asar/ts/sql/Server.js:4408:7\n at sqliteTransaction ([REDACTED]/resources/app.asar/node_modules/@signalapp/better-sqlite3/lib/methods/transaction.js:65:24)\n at Object.modifyStoryDistributionWithMembers ([REDACTED]/resources/app.asar/ts/sql/Server.js:4409:7)\n at async MessagePort. ([REDACTED]/resources/app.asar/ts/sql/mainWorker.js:108:22)\n at a.invoke (node:electron/js2c/renderer_init:2:7723)\n at async [REDACTED]/resources/app.asar/preload.bundle.js:85:23908\n at async run ([REDACTED]/resources/app.asar/preload.bundle.js:71:663266)\n at async [REDACTED]/resources/app.asar/preload.bundle.js:71:663299\n at async [REDACTED]/resources/app.asar/preload.bundle.js:89:284790"}

main.log

{"level":40,"time":"2023-11-17T14:09:54.178Z","msg":"MainSQL: Database log code=1: near \"?\": syntax error in \"\n DELETE FROM storyDistributionMembers\n WHERE listId = ? AND serviceId IN (?????);\n \""} {"level":50,"time":"2023-11-17T14:09:54.178Z","msg":"Error occurred in handler for 'sql-channel': {}"}

env

Signal Desktop 6.39.0 iOS 17.1.1 with Signal 6.50.0.13

vnj0x61 commented 7 months ago

@mthld i tried the last days to reproduce the error but was not able. I think because i had set it over the Desktop. Can you try it in this direction? Do you have the same problem?

Other note: After all tests i thought to deactivate the Stories in Desktop Client and reactivate might help. Now the stories are gone in the Desktop Client. I am not able to reactivate, other bug BUT maybe it is a workaround.

  1. Deactivate Stories in Desktop Client
  2. Activate Stories in iOS App
cityrolr commented 7 months ago

@vnj0x61 Other note: After all tests i thought to deactivate the Stories in Desktop Client and reactivate might help. Now the stories are gone in the Desktop Client. I am not able to reactivate, other bug BUT maybe it is a workaround.

Deactivate Stories in Desktop Client Activate Stories in iOS App

Tried this as a workaround, the desktop client doesn't reactivate stories as you said but also the iOS client sets itself to one of the options where some people are excluded.

ghost commented 7 months ago

@harry-signal, @sashaweiss-signal, anything useful in those logs I shared?

The issue is still happening and it's quite worrying to not know what content I might be sending to whom. 😕

harry-signal commented 7 months ago

@harry-signal, @sashaweiss-signal, anything useful in those logs I shared?

The issue is still happening and it's quite worrying to not know what content I might be sending to whom. 😕

@mthld Really sorry this is happening! This is quite a tricky issue as there's lots of different things that could be going wrong. Sorry to have to enlist your help to debug, but it would be very helpful if you could try some stuff out! We are unable to reproduce the issue on our own accounts.

Could you try:

  1. Reset the recipients to All Signal Connections on your phone
  2. Launch signal on desktop and verify my story settings are set to All Signal Connections
  3. On your phone, change it to "Only share with..."
  4. Relaunch (quit + reopen) signal desktop, and see if it updates (giving it a second or two to catch up)
  5. On desktop, change it to a different setting, "All Except..." (pick whoever)
  6. Relaunch (force quit + reopen) signal on your phone and see if it updates (again giving it a second or two)

If you can, let me know what happens on steps 4 and 6! It would be helpful to know if the update is being lost on its way from the phone to desktop, or on its way from desktop back to the phone!

(Once you are done you can set your recipient settings back to whatever your preference is)

harry-signal commented 7 months ago

Update (and sorry if you were midway through the debugging steps I asked you to do above!): we've found the root cause!

Thanks for reporting this and helping us uncover the root problem! There should hopefully be a fix going out in a nearby Desktop client release. (May be slightly delayed by American holidays this week)