Closed taoeffect closed 2 hours ago
Update: This problem is still happening, because giAcceptGroupInvite
eventually calls giCheckIfJoinedChatroom
via giLogin
=> cy.giCheckIfJoinedGeneralChatroom(username)
=> cy.giCheckIfJoinedChatroom(CHATROOM_GENERAL_NAME, username)
.
And we have this call in user3 joins the ${groupName1} group and ${CHATROOM_GENERAL_NAME} channel again and logout
:
cy.giAcceptGroupInvite(invitationLinkAnyone, {
username: user3,
groupName: groupName1,
existingMemberUsername: user1,
shouldLogoutAfter: false,
isLoggedIn: true,
bypassUI: true
})
And in giCheckIfJoinedChatroom
we have this call:
if (inviter) {
cy.get('.c-message:last-child .c-who > span:first-child').should('contain', inviter)
}
Which seems to be where the problem is happening.
This shows a comparison of a passing (left) and failing (right) build, suggesting that either the last two messages (u2 and u3) are reversed, or the u3 message is missing, or... something even crazier is happening.
Because this heisenbug is such a persistent problem, I've commented out the test as a temporary measure until someone is able to figure it out:
cy.getByDT('conversationWrapper').within(($el) => {
if (inviter) {
// TODO: fix this heisenbug here: https://github.com/okTurtles/group-income/issues/2256
// cy.get('.c-message:last-child .c-who > span:first-child').scrollIntoView()
// cy.get('.c-message:last-child .c-who > span:first-child').should('contain', inviter)
}
It turns out commenting that out in #2280 just leads to a different, related heisenbug!
I attempted a fix, which didn't work, so now I've pushed a commit to #2280 that gives up completely on performing these checks:
// failed attempt to fix heisenbug: https://github.com/okTurtles/group-income/issues/2256
// if (inviter) {
// cy.get('[data-test="conversationWrapper"] .c-message:last-child .c-who > span:first-child').should('contain', inviter)
// }
// const message = selfJoin ? `Joined ${channelName}` : `Added a member to ${channelName}: ${invitee}`
// cy.get('[data-test="conversationWrapper"] .c-message:last-child .c-notification').should('contain', message)
// original code follows:
// cy.getByDT('conversationWrapper').within(($el) => {
// if (inviter) {
// // TODO: fix heisenbug: https://github.com/okTurtles/group-income/issues/2256
// // cy.get('.c-message:last-child .c-who > span:first-child').scrollIntoView()
// // cy.get('.c-message:last-child .c-who > span:first-child').should('contain', inviter)
// }
// const message = selfJoin ? `Joined ${channelName}` : `Added a member to ${channelName}: ${invitee}`
// cy.get('.c-message:last-child .c-notification').should('contain', message)
// })
Possibly related heisenbug that appears when all of that code is commented out in this build:
Here's the video for this one:
https://github.com/user-attachments/assets/49b45c88-afb4-4921-8d8d-25051d4dda31
Which I got by repeatedly running the test locally with:
while npx cypress run -c 'baseUrl=http://localhost:8000' --spec "test/cypress/integration/group-chat.spec.js"; do :; done
And yet a different one, also in group-chat, this time with video from Cypress Dashboard!
Might've been fixed by @corrideat in #2294
Problem
https://github.com/user-attachments/assets/772eebd1-dacc-44e3-95ee-8a99ed0f2a48
Test failure info:
Solution
Uncomment that out and push a PR to verify the tests are still failing because of that line.
Figure out the problem and fix.