diff --git a/frontend/views/containers/chatroom/ChatMain.vue b/frontend/views/containers/chatroom/ChatMain.vue index 6b439b96d..dd1f6578f 100644 --- a/frontend/views/containers/chatroom/ChatMain.vue +++ b/frontend/views/containers/chatroom/ChatMain.vue @@ -406,6 +406,7 @@ export default ({ const sendMessage = (beforePrePublish) => { let pendingMessageHash = null const beforeRequest = (message, oldMessage) => { + console.error('@@@@beforeRequest', performance.now(), message, oldMessage) if (!this.checkEventSourceConsistency(contractID)) return sbp('okTurtles.eventQueue/queueEvent', CHATROOM_EVENTS, async () => { if (!this.checkEventSourceConsistency(contractID)) return @@ -475,6 +476,7 @@ export default ({ data, hooks: { preSendCheck: async (message, state) => { + console.error('@@@preSendCheck', performance.now(), message) // NOTE: this preSendCheck does nothing except appending a pending message // temporarily until the uploading attachments is finished // it always returns false, so it doesn't affect the contract state @@ -488,6 +490,7 @@ export default ({ } } }).then(async () => { + console.error('@@@preSendCheck addMsg', performance.now()) await uploadAttachments() const removeTemporaryMessage = () => { // NOTE: remove temporary message which is created before uploading attachments diff --git a/shared/domains/chelonia/GIMessage.js b/shared/domains/chelonia/GIMessage.js index e772b2bd9..e7130b81b 100644 --- a/shared/domains/chelonia/GIMessage.js +++ b/shared/domains/chelonia/GIMessage.js @@ -237,7 +237,11 @@ export class GIMessage { { contractID, previousHEAD = null, - height = 0, + // Height will be automatically set to the correct value when sending + // The reason to set it to Number.MAX_SAFE_INTEGER is so that we can + // temporarily process outgoing messages with signature validation + // still working + height = Number.MAX_SAFE_INTEGER, op, manifest }: { diff --git a/shared/domains/chelonia/chelonia.js b/shared/domains/chelonia/chelonia.js index 7e28ba4ac..fad0d9b77 100644 --- a/shared/domains/chelonia/chelonia.js +++ b/shared/domains/chelonia/chelonia.js @@ -1134,6 +1134,7 @@ export default (sbp('sbp/selectors/register', { }: GIOpContract) const contractMsg = GIMessage.createV1_0({ contractID: null, + height: 0, op: [ GIMessage.OP_CONTRACT, signedOutgoingDataWithRawKey(signingKey, payload) diff --git a/test/cypress/integration/group-contributions.spec.js b/test/cypress/integration/group-contributions.spec.js index e6d97b528..655b2ae68 100644 --- a/test/cypress/integration/group-contributions.spec.js +++ b/test/cypress/integration/group-contributions.spec.js @@ -32,7 +32,7 @@ function assertNonMonetaryEditableValue (name) { cy.getByDT('buttonEditNonMonetaryContribution').click() cy.getByDT('inputNonMonetaryContribution').should('have.value', name) - cy.getByDT('buttonSaveNonMonetaryContribution').click() + cy.getByDT('buttonCancelNonMonetaryContribution').click() } function assertGraphicSummary (legendListItems) {