Just before merging PR #2294, a ChelErrorSignatureKeyUnauthorized error was thrown. This is a serious error indicating key management issues that will result in degraded user experience.
From the corresponding logs, the following could be inferred:
Error
["error","[chelonia] ERROR 'ChelErrorSignatureKeyUnauthorized' in processMutation for
<op_ae|z9brRu3VKBEb7nxkHShu1Usg4aQvKmAAcuotb4xT7LJFAwFYtYSK
of z9brRu3VLst3nZSbPnf4d53s3zb4nS1mmcCW7Wf6wSmtzLSw6Ddz>:
Key z2DrjgbDaRKraoj7qSStdtA3weZ6WrL4S4LqnXaTZn3Stud4rjm is unauthorized or expired
for the current contract",{"name":"ChelErrorSignatureKeyUnauthorized"}]
{"_signedData":["{\\"action\\":\\"gi.contracts/chatroom/addMessage\\",\\"data\\":{\\"type\\":\\"interactive\\",\\"proposal\\":{\\"proposalType\\":\\"remove-member\\",\\"proposalData\\":{\\"memberID\\":\\"z9brRu3VMc1WMhzBwM3p5ogvy4fCNX5ezfFiiDtqXk8JBjuiF6b4\\",\\"reason\\":\\"I think it is a bot!\\"},\\"expires_date_ms\\":1726777536087,\\"createdDate\\":\\"2024-09-05T20:25:36.092Z\\",\\"creatorID\\":\\"z9brRu3VUVse7woMHoc9KQwEzoi9jamWeVdf3UuK9wqfBzucpb4u\\",\\"proposalId\\":\\"z9brRu3VWq4uSpEXXBGbhiYd51VovnpQCgjS7NtGYT48NBQi8hih\\",\\"status\\":\\"passed\\"}},\\"meta\\":{\\"createdDate\\":\\"2024-09-05T20:25:40.339Z\\"}}","z2DrjgbDaRKraoj7qSStdtA3weZ6WrL4S4LqnXaTZn3Stud4rjm","uL8s/Q156MbLcNRNt/DJfGSsFdQy9+U5CxzsKdgXJh2x6QK+ftO6QYhYJSME632JLeTUNVW4m/t4kuRBvvqFBA=="]}
Stacktrace
2024-09-05T20:25:53.0467132Z at Object.verifySignatureData (http://127.0.0.1:8000/assets/js/chunk-CWIVWHQ5-cached.js:7727:22)
2024-09-05T20:25:53.0468111Z at Object.verifySignedValueFn (http://127.0.0.1:8000/assets/js/chunk-CWIVWHQ5-cached.js:7826:45)
2024-09-05T20:25:53.0469050Z at validateActionPermissions (http://127.0.0.1:8000/assets/js/chunk-CWIVWHQ5-cached.js:8625:40)
2024-09-05T20:25:53.0469977Z at validateKeyPermissions (http://127.0.0.1:8000/assets/js/chunk-CWIVWHQ5-cached.js:8655:81)
2024-09-05T20:25:53.0471224Z at Object.chelonia/private/in/processMessage (http://127.0.0.1:8000/assets/js/chunk-CWIVWHQ5-cached.js:10014:12)
2024-09-05T20:25:53.0472198Z at sbp (http://127.0.0.1:8000/assets/js/chunk-MN2RILWH-cached.js:32:25)
2024-09-05T20:25:53.0473049Z at Object.processMutation (http://127.0.0.1:8000/assets/js/chunk-CWIVWHQ5-cached.js:10530:11)
2024-09-05T20:25:53.0474077Z at Object.chelonia/private/in/handleEvent (http://127.0.0.1:8000/assets/js/chunk-CWIVWHQ5-cached.js:10434:43)
2024-09-05T20:25:53.0474973Z at sbp (http://127.0.0.1:8000/assets/js/chunk-MN2RILWH-cached.js:32:25)
2024-09-05T20:25:53.0475901Z at Object.chelonia/private/in/syncContract (http://127.0.0.1:8000/assets/js/chunk-CWIVWHQ5-cached.js:10076:17)
Problem diagnosis
When user2 votes on the proposal to remove userBot, it sends a message to the #general chatroom as the proposal passes.
A previous test was for user2 to join the group, leave and then re-join. It seems that, at least from the perspective of user1 and userBot (need to confirm whether this also was the case for user2), the action to re-join the #general chatroom was never processed (this could be due to a processing error or due to it never having been sent).
The video of the run, at around the 1:00 mark, shows that user2 has left#general but hasn't rejoined.
As a result, when user2 sends this message, the inner payload uses an inner signing key that has been revoked (when user2 left the group). This triggers the error in question, as expected. The correct behaviour in this case would be to make sure that user2 rejoins the #general chatroom when re-joining a group, and that this action is correctly processed by all members.
Solution
As noted, the error is expected due to another underlying error (user2 not rejoining the #general chatroom). The solution is to diagnose why this happened and address this situation so that it doesn't happen.
Problem
Just before merging PR #2294, a
ChelErrorSignatureKeyUnauthorized
error was thrown. This is a serious error indicating key management issues that will result in degraded user experience.The error manifested in the second attempt of the pre-merge GitHub action run.
From the corresponding logs, the following could be inferred:
Error
Message affected
group-member-removal.spec.js
z9brRu3VKBEb7nxkHShu1Usg4aQvKmAAcuotb4xT7LJFAwFYtYSK
z9brRu3VLst3nZSbPnf4d53s3zb4nS1mmcCW7Wf6wSmtzLSw6Ddz
(#general
chatroom)z2DrjgbDaRKraoj7qSStdtA3weZ6WrL4S4LqnXaTZn3Stud4rjm
(CSK belonging touser2-12171000000000731233740
, contract IDz9brRu3VLnfskSdZVtm3Tu7uomef5KyZsD69MRwG2BsDJCSZEztW
)Message contents
Inner payload (decrypted)
Stacktrace
Problem diagnosis
When user2 votes on the proposal to remove
userBot
, it sends a message to the#general
chatroom as the proposal passes.A previous test was for
user2
to join the group, leave and then re-join. It seems that, at least from the perspective ofuser1
anduserBot
(need to confirm whether this also was the case foruser2
), the action to re-join the#general
chatroom was never processed (this could be due to a processing error or due to it never having been sent).The video of the run, at around the 1:00 mark, shows that
user2
has left#general
but hasn't rejoined.As a result, when
user2
sends this message, the inner payload uses an inner signing key that has been revoked (whenuser2
left the group). This triggers the error in question, as expected. The correct behaviour in this case would be to make sure thatuser2
rejoins the#general
chatroom when re-joining a group, and that this action is correctly processed by all members.Solution
As noted, the error is expected due to another underlying error (
user2
not rejoining the#general
chatroom). The solution is to diagnose why this happened and address this situation so that it doesn't happen.