From 2f944292ba3d940464975cb8d80ad8ca994222b4 Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Fri, 12 Aug 2022 09:06:51 +0200 Subject: [PATCH] fix: Secret storage keys are used as account data but are not uri encoded This always encodes the storage key so it can be used as account data. Before the app has waited failed to use this key at all so we do not need a migration. --- lib/src/model/event_types.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/src/model/event_types.dart b/lib/src/model/event_types.dart index b948c8a2..3878cb7a 100644 --- a/lib/src/model/event_types.dart +++ b/lib/src/model/event_types.dart @@ -81,7 +81,9 @@ abstract class EventTypes { static const String MegolmBackup = 'm.megolm_backup.v1'; static const String SecretStorageDefaultKey = 'm.secret_storage.default_key'; - static String secretStorageKey(String keyId) => 'm.secret_storage.key.$keyId'; + // Also used as account data type so it needs to be uri encoded + static String secretStorageKey(String keyId) => + Uri.encodeComponent('m.secret_storage.key.$keyId'); // Spaces static const String spaceParent = 'm.space.parent';