That said, if you forget your password you do lose remote synced data. The hope is that you have at least one device connected that still has the data, which will upload it in that case. This doesn't work in all cases (there's a pretty common and unfortunate pattern where someone reinstalls their OS, doesn't remember their password, and loses data as a result)
You can also generate and store a separate recovery key to help avoid data loss, https://support.mozilla.org/en-US/kb/reset-your-firefox-acco....
>how does telegram do this?
...the short answer is they don't.
I don't disagree about recovery keys, they're rather new though, eventually it wouldn't surprise me if we did something like that.
But we don't use the sync key to encrypt local data ever; many users never set up sync, and have no sync key
I’m unsure of what alternative there is that avoids that risk while still providing the current privacy benefits.