Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing website is broken (users not joining properly) #2064

Open
taoeffect opened this issue Jun 13, 2024 · 2 comments
Open

Testing website is broken (users not joining properly) #2064

taoeffect opened this issue Jun 13, 2024 · 2 comments

Comments

@taoeffect
Copy link
Member

Problem

User appears to join group but their name isn't shown in the chat and their user doesn't appear in the user list.

Screenshot 2024-06-13 at 11 15 44 AM

Screenshot 2024-06-13 at 11 15 49 AM

But - if page is refreshed, then it shows:

Screenshot 2024-06-13 at 11 20 57 AM

And everything is fine.

Solution

Find and fix the problem.

Database is attached.

  • Username: greg
  • Password: asdfasdf

groupincome.testing-2024-06-13.db.zip

@taoeffect
Copy link
Member Author

taoeffect commented Jun 13, 2024

Note that one of the errors I'm seeing on the backend is:

[11:19:57.845] ERROR (77): GET /eventsAfter/undefined/0 contractID undefined doesn't exist!                                                                                                                                                                                                                                  
    err: {                                                                                                                                                                                                                                                                                                                   
      "type": "Error",                                                                                                                                                                                                                                                                                                       
      "message": "contractID undefined doesn't exist!",                                                                                                                                                                                                                                                                      
      "stack":                                                                                                                                                                                                                                                                                                               
          Error: contractID undefined doesn't exist!                                                                                                                                                                                                                                                                         
              at Object.backend/db/streamEntriesAfter (/home/unpriv/gi/backend/database.js:47:18)                                                                                                                                                                                                                            
              at /home/unpriv/gi/backend/routes.js:128:20                                                                                                                                                                                                                                                                    
              at exports.Manager.execute (/home/unpriv/gi/node_modules/@hapi/hapi/lib/toolkit.js:60:28)                                                                                                                                                                                                                      
              at Object.internals.handler (/home/unpriv/gi/node_modules/@hapi/hapi/lib/handler.js:46:20)                                                                                                                                                                                                                     
              at exports.execute (/home/unpriv/gi/node_modules/@hapi/hapi/lib/handler.js:31:20)                                                                                                                                                                                                                              
              at Request._lifecycle (/home/unpriv/gi/node_modules/@hapi/hapi/lib/request.js:372:32)                                                                                                                                                                                                                          
              at Request._execute (/home/unpriv/gi/node_modules/@hapi/hapi/lib/request.js:280:9)                                                                                                                                                                                                                             
      "data": null,                                                                                                                                                                                                                                                                                                          
      "isBoom": true,                                                                                                                                                                                                                                                                                                        
      "isServer": false,                                                                                                                                                                                                                                                                                                     
      "output": {                                                                                                                                                                                                                                                                                                            
        "statusCode": 404,                                                                                                                                                                                                                                                                                                   
        "payload": {                                                                                                                                                                                                                                                                                                         
          "statusCode": 404,                                                                                                                                                                                                                                                                                                 
          "error": "Not Found",                                                
          "message": "contractID undefined doesn't exist!"                     
        },
        "headers": {}
      }
    }
[11:19:57.846] ERROR (77): Debug: handler, error 
    Error: contractID undefined doesn't exist!
    at Object.backend/db/streamEntriesAfter (/home/unpriv/gi/backend/database.js:47:18)
    at /home/unpriv/gi/backend/routes.js:128:20
    at exports.Manager.execute (/home/unpriv/gi/node_modules/@hapi/hapi/lib/toolkit.js:60:28)
    at Object.internals.handler (/home/unpriv/gi/node_modules/@hapi/hapi/lib/handler.js:46:20)
    at exports.execute (/home/unpriv/gi/node_modules/@hapi/hapi/lib/handler.js:31:20)
    at Request._lifecycle (/home/unpriv/gi/node_modules/@hapi/hapi/lib/request.js:372:32)
    at Request._execute (/home/unpriv/gi/node_modules/@hapi/hapi/lib/request.js:280:9)
[11:20:14.230] ERROR (77): GET /eventsAfter/undefined/0 contractID undefined doesn't exist!
    err: {
      "type": "Error",
      "message": "contractID undefined doesn't exist!",
      "stack":
          Error: contractID undefined doesn't exist!
              at Object.backend/db/streamEntriesAfter (/home/unpriv/gi/backend/database.js:47:18)
              at /home/unpriv/gi/backend/routes.js:128:20
              at exports.Manager.execute (/home/unpriv/gi/node_modules/@hapi/hapi/lib/toolkit.js:60:28)
              at Object.internals.handler (/home/unpriv/gi/node_modules/@hapi/hapi/lib/handler.js:46:20)
              at exports.execute (/home/unpriv/gi/node_modules/@hapi/hapi/lib/handler.js:31:20)
              at Request._lifecycle (/home/unpriv/gi/node_modules/@hapi/hapi/lib/request.js:372:32)
              at Request._execute (/home/unpriv/gi/node_modules/@hapi/hapi/lib/request.js:280:9)
      "data": null,             
      "isBoom": true,
      "isServer": false,
      "output": {
        "statusCode": 404,
        "payload": {
          "statusCode": 404,
          "error": "Not Found",
          "message": "contractID undefined doesn't exist!"
        },
        "headers": {}
      }                         
    }

@corrideat
Copy link
Member

The undefined thing, although probably harmless by itself, shouldn't be happening and I believe I've found most instances where it happens (finding all instances requires a pretty deep look and analysis of the codebase). It is / was also probably related to this error, in the sense that it'd happen when attempting to display a user profile with an undefined contract ID.

Now, regarding this error, I'm still investigating. It's quite weird, because the situations that'd make it happen require several things going wrong somewhere.

If a member's contract is removed, it'd result in the undefined issue above. You also wouldn't see them as a member in the chatroom if you clicked on the 'X members' text. These things I've fixed.

However, what's strange here is that you have both text saying 1 members (it should say 2, obviously) and the z9... Joined general text. The Joined general message is created in gi.contracts/chatroom/join/process, right after updating .members. Since the member count seems to come from .members directly, the count should be 2, not 1. Well, this unless the member later was removed (talking at the state level, not specifically saying that Alex left the group or chatroom, which I know didn't happen) without triggering another notification nor an error.

I don't suppose you still have the state, do you? Whenever such weird things happen, especially those that are hard to reproduce, a full copy of the state (state/vuex/state), logs and database is useful, in that order.

corrideat added a commit that referenced this issue Jun 17, 2024
* eventsAfter: Reject early if the contractID is not set
* Fix instances causing such unset contractIDs
* Fix group members list to include members with only a contractID
* Don't set an empty contract state when receiving OP_KEY_SHARE
* Files: laxer validation when removing to process individual files separately
corrideat added a commit that referenced this issue Jun 17, 2024
* eventsAfter: Reject early if the contractID is not set
* Fix instances causing such unset contractIDs
* Fix group members list to include members with only a contractID
* Don't set an empty contract state when receiving OP_KEY_SHARE
* Files: laxer validation when removing to process individual files separately
corrideat added a commit that referenced this issue Jun 17, 2024
* eventsAfter: Reject early if the contractID is not set
* Fix instances causing such unset contractIDs
* Fix group members list to include members with only a contractID
* Don't set an empty contract state when receiving OP_KEY_SHARE
* Files: laxer validation when removing to process individual files separately
corrideat added a commit that referenced this issue Jun 18, 2024
* eventsAfter: Reject early if the contractID is not set
* Fix instances causing such unset contractIDs
* Fix group members list to include members with only a contractID
* Don't set an empty contract state when receiving OP_KEY_SHARE
* Files: laxer validation when removing to process individual files separately
* Increase shelter header validity window
corrideat added a commit that referenced this issue Jun 18, 2024
* eventsAfter: Reject early if the contractID is not set
* Fix instances causing such unset contractIDs
* Fix group members list to include members with only a contractID
* Don't set an empty contract state when receiving OP_KEY_SHARE
* Files: laxer validation when removing to process individual files separately
* Increase shelter header validity window
taoeffect pushed a commit that referenced this issue Jun 18, 2024
* eventsAfter: Reject early if the contractID is not set
* Fix instances causing such unset contractIDs
* Fix group members list to include members with only a contractID
* Don't set an empty contract state when receiving OP_KEY_SHARE
* Files: laxer validation when removing to process individual files separately
* Increase shelter header validity window
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants