• Gamers

    I want to vote a post in my nodebb, but nothing happen, no error log.
    how can I debug?

  • GNU/Linux Admin

    Hi there,

    Can you please provide the following information to help us debug?

    1. Server or client operating system (if applicable)
    2. NodeBB version and hash
      • To get the hash, run git rev-parse HEAD from the root of your NodeBB folder
    3. If applicable, theme versions
      • npm ls nodebb-theme-persona
    4. Do you see any errors in the client-side?

    Thanks!

  • Gamers

    1. CentOS release 6.6 (Final)

    2. #git rev-parse HEAD
      d9af2242a7c7fc92318a83bd46e4f849094960f2

    3. I am not using nodebb-theme-persona, but nodebb-theme-lavender.

    4. error at client-side
      "Error
      Invalid Data"

  • Admin

    This rings a bell, I think I fixed this recently. Can you update to latest 0.7x and latest lavender and let me know?

    EDIT: lav's dependant on vanilla as well so update that too please

  • Gamers

    I had changed to nodebb-theme-persona, it has the same problem.

  • Gamers

    I found the error is come from favouriteCommand, and added some debug output:

        function favouriteCommand(socket, command, eventName, notification, data, callback) {
        winston.info('command=`' + JSON.stringify(command) );
        winston.info('eventName=`' + JSON.stringify(eventName) );
        winston.info('notification=`' + JSON.stringify(notification) );
        winston.info('data=`' + JSON.stringify(data) );
    
            if(!data || !data.pid || !data.room_id) {
        winston.error('favouriteCommand invalid-data');
                return callback(new Error('[[error:invalid-data]]'));
            }
  • Gamers

    the debug output as below:

    4/6 03:55 [387] - info: command=`"upvote"
    4/6 03:55 [387] - info: eventName=`"voted"
    4/6 03:55 [387] - info: notification=`"notifications:upvoted_your_post_in"
    4/6 03:55 [387] - info: data=`{"pid":"85","room_id":""}
    4/6 03:55 [387] - error: favouriteCommand invalid-data
    

    Does anyone have idea what's going wrong?

  • Gamers

    temp solution:

    -- 	if(!data || !data.pid || !data.room_id) {
    ++ if(!data || !data.pid) {
  • Gamers Admin

    That's weird the room_id should be something like topic_<topic_id> where topic_id is the id of the topic you are in.

    When this happens what is the value of app.currentRoom client side?

  • Gamers

    The code is in src/socket.io/posts.js, but I can't find the topic_id and app.currentRoom you mention.

Suggested Topics

| |