mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-22 17:38:10 +01:00
Proper session reset: Delete sessions before and after (#1796)
* web requests: Don't fail if JSON not well-formed in error cases Turns out that before our move to node-fetch, we ignored JSON.parse() failures: https://github.com/WhisperSystems/Signal-Desktop/pull/1552/files#diff-1103a6aff0f28b6066715c6994278767L37518 * Update to libsignal v1.2.0, delete sessions on reset session Previously we only archived sessions when sending or receiving a 'reset secure session, which didn't match up with the mobile apps.
This commit is contained in:
@@ -65,7 +65,16 @@ var TextSecureServer = (function() {
|
||||
window.nodeFetch(url, fetchOptions).then(function(response) {
|
||||
var resultPromise;
|
||||
if (options.responseType === 'json') {
|
||||
resultPromise = response.json();
|
||||
resultPromise = response.json().catch(function(error) {
|
||||
// If the response was otherwise successful, a JSON.parse() failure really
|
||||
// is a problem. But the Signal server does return HTML in error cases
|
||||
// when we requested JSON, sadly.
|
||||
if (0 <= response.status && response.status < 400) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
return null;
|
||||
})
|
||||
} else if (!options.responseType || options.responseType === 'text') {
|
||||
resultPromise = response.text();
|
||||
} else if (options.responseType === 'arraybuffer') {
|
||||
|
||||
Reference in New Issue
Block a user