Commit f643208
fix(ui): detect awaiting sync for owner imports via config signature (#200)
* fix(ui): detect awaiting sync for owner imports via config signature
The previous is_awaiting_initial_sync() had an owner bypass that returned
false immediately for room owners. This caused owner identity imports to
skip the GET-first sync flow, PUT the default state (unsigned config)
directly to the contract, and allow message sends before sync completed.
Every UPDATE then failed with "State verification failed: Invalid
signature: signature error" because the default AuthorizedConfigurationV1
is signed by SigningKey([0; 32]), not the real owner.
Fix: check whether the configuration signature verifies against the
owner's key instead of using ownership as a proxy for "already synced".
This correctly detects the placeholder state for both owner and non-owner
imports, while newly-created rooms pass (their config is signed by the
real owner at creation time).
Updated the test to cover the owner-import case (the exact bug) using
AuthorizedConfigurationV1::default() for imported rooms instead of a
properly-signed config.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: update stale comment in get_response.rs
The comment referenced the old is_awaiting_initial_sync logic ("returns
false once members are populated"). Updated to reflect the new
signature-based check.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent a8b5744 commit f643208
2 files changed
Lines changed: 32 additions & 50 deletions
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
620 | 620 | | |
621 | 621 | | |
622 | 622 | | |
623 | | - | |
| 623 | + | |
624 | 624 | | |
625 | 625 | | |
626 | 626 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
104 | | - | |
105 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
106 | 106 | | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
111 | 111 | | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
118 | 116 | | |
119 | 117 | | |
120 | 118 | | |
| |||
1020 | 1018 | | |
1021 | 1019 | | |
1022 | 1020 | | |
1023 | | - | |
1024 | | - | |
1025 | | - | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
1026 | 1030 | | |
1027 | 1031 | | |
1028 | 1032 | | |
1029 | | - | |
1030 | 1033 | | |
1031 | 1034 | | |
1032 | 1035 | | |
| |||
1044 | 1047 | | |
1045 | 1048 | | |
1046 | 1049 | | |
1047 | | - | |
1048 | | - | |
| 1050 | + | |
| 1051 | + | |
1049 | 1052 | | |
1050 | 1053 | | |
1051 | | - | |
1052 | | - | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
1053 | 1061 | | |
1054 | 1062 | | |
1055 | | - | |
1056 | | - | |
1057 | | - | |
1058 | | - | |
1059 | | - | |
1060 | | - | |
1061 | | - | |
1062 | | - | |
| 1063 | + | |
| 1064 | + | |
1063 | 1065 | | |
1064 | | - | |
1065 | | - | |
1066 | | - | |
1067 | | - | |
1068 | | - | |
1069 | | - | |
1070 | | - | |
1071 | | - | |
1072 | | - | |
1073 | | - | |
1074 | | - | |
1075 | | - | |
1076 | | - | |
1077 | | - | |
1078 | | - | |
1079 | | - | |
1080 | | - | |
1081 | | - | |
1082 | | - | |
1083 | | - | |
1084 | 1066 | | |
1085 | 1067 | | |
1086 | 1068 | | |
| |||
0 commit comments