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] Trailing space at end of address causes Session to not progress past splash screen #2872

Closed powerLien closed 10 months ago

powerLien 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

My Session is currently not starting on desktop, and I found this error when I ran the appimage from the command line.

{"name":"log","hostname":"toaster-oven","pid":2297076,"level":50,"msg":"Error received from worker job 440 (ContactsConfig): Invalid session ID: expected 66 hex digits starting with 05; got 05e998a1ee8fa8ed675e709110d4e27c5bee4fdddf9645a0a37c2ce6b773419828 ","time":"2023-08-22T11:10:16.224Z","v":0} {"name":"log","hostname":"toaster-oven","pid":2297076,"level":30,"msg":"Worker job 440 (ContactsConfig) failed in 0ms with Error received from worker job 440 (ContactsConfig): Invalid session ID: expected 66 hex digits starting with 05; got 05e998a1ee8fa8ed675e709110d4e27c5bee4fdddf9645a0a37c2ce6b773419828 ","time":"2023-08-22T11:10:16.225Z","v":0}

It looks like a space was somehow put onto the end of the key, most likely when it was stored in the database, and it's tripping up the ContactsConfig worker when it reads from there. Because my database file is encrypted with a password, I am unsure as to how to unlock the database to remove the whitespace (per what was done by the reporter for #2868). I am thus unable to proceed further than the splash screen after typing in the password.

This originally happened on version 1.10.0. I attempted to remedy it by compiling the application from source and then placing the files from the original Session config folder into the Session-production-devprod config folder that was generated upon startup. The devprod version is where the above error message was taken from.

Expected Behavior

It should trim whitespace from both ends before storing keys into the database, and ideally it should trim whitespace it finds as it reads from the database.

Steps To Reproduce

I am unsure how exactly this happened. The ID that has a whitespace was added some time before the application started doing this. I believe this behavior started after I restarted the application after it was open for a time.

Desktop Version

1.11.0; also the most recent commit compiled from source as of time of writing

Anything else?

No response

Bilb commented 11 months ago

Hey, do you have a way to test an binary with a fix before I merge it?