oxen-io / session-desktop

Session Desktop - Onion routing based messenger
https://getsession.org
GNU General Public License v3.0
1.48k stars 190 forks source link

[BUG] Prefixing to address with a space permanently breaks database #2868

Closed gemdude46 closed 1 year ago

gemdude46 commented 1 year ago

Code of conduct

Self-training on how to write a bug report

Is there an existing issue for this?

Current Behavior

Upon creating a new conversation (+ > New Message), entering an ID with leading whitespace, and sending a message, the Session application will cease to function. If closed, it will not be able to reopen for the current user.

This is caused by the whitespace being saved in the id column of the conversations table, resulting in check_session_id failing with the message Invalid session ID: expected 66 hex digits starting with 05, and the application not proceeding beyond the splash screen.

Once this has happened, the only way to fix it is to manually edit db.sqlite and remove the offending row.

Expected Behavior

Either:

Steps To Reproduce

  1. Create a new conversation ( + > New Message )
  2. In "Enter Session ID or ONS Name", enter a space followed by a valid Session ID
  3. Click Next
  4. Send a message

Desktop Version

v1.11.0

Anything else?

Platform: Debian Linux 6.1.27-1 x86_64 Commit: 448c9dc14bd64eebae03676e360bf78ae2a54920