fix(nip46): fix bunker decrypt/encrypt response parsing and increase timeout
Two issues fixed: 1. BunkerResponseDeserializer produces generic BunkerResponse for decrypt/encrypt results (plain strings that aren't pubkeys or JSON). The response parsers only matched typed subtypes (BunkerResponseDecrypt/Encrypt), causing all decrypt and encrypt operations through NIP-46 bunker to fail with ReceivedButCouldNotPerform. Fix: parsers now fall back to extracting response.result directly. 2. RemoteSignerManager timeout was 30s, shorter than Amber's 60s approval window. Fix: increased to 65s with safe retry (republishes same request, preserving UUID so bunker responses always match). 3. Desktop ChatPane showed raw ciphertext on decrypt failure instead of an error message. Fix: shows "Could not decrypt the message" in italic. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
+17
-6
@@ -455,7 +455,7 @@ private fun MessageWithReactions(
|
||||
try {
|
||||
event.decryptContent(account.signer)
|
||||
} catch (_: Exception) {
|
||||
event.content
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
@@ -597,11 +597,22 @@ private fun MessageWithReactions(
|
||||
|
||||
else -> {
|
||||
SelectionContainer {
|
||||
Text(
|
||||
text = decryptedContent ?: "",
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
color = MaterialTheme.colorScheme.onSurface,
|
||||
)
|
||||
if (decryptedContent != null) {
|
||||
Text(
|
||||
text = decryptedContent!!,
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
color = MaterialTheme.colorScheme.onSurface,
|
||||
)
|
||||
} else {
|
||||
Text(
|
||||
text = "Could not decrypt the message",
|
||||
style =
|
||||
MaterialTheme.typography.bodyMedium.copy(
|
||||
fontStyle = androidx.compose.ui.text.font.FontStyle.Italic,
|
||||
),
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user