Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
corrideat committed Nov 29, 2024
1 parent d065020 commit 0aed55b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions frontend/views/containers/chatroom/ChatMain.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
6 changes: 5 additions & 1 deletion shared/domains/chelonia/GIMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}: {
Expand Down
1 change: 1 addition & 0 deletions shared/domains/chelonia/chelonia.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion test/cypress/integration/group-contributions.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 0aed55b

Please sign in to comment.