• DDMsgReader - User gets stuck logged in if they close connection

    From Nigel Reed@1:103/705 to GitLab issue in main/sbbs on Monday, February 26, 2024 19:00:03
    open https://gitlab.synchro.net/main/sbbs/-/issues/724

    I just tested this which seems to confirm an issue keyop had earlier.

    I logged in with SyncTerm and went to read an email with DDMsgReader.

    While reading a message, I closed SyncTerm with the X button. However, the users is still showing logged on.

    So it looks like DDMsgReader needs some checks for users disconnecting at various places.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Eric Oulashin@1:103/705 to GitLab note in main/sbbs on Monday, February 26, 2024 19:06:50
    https://gitlab.synchro.net/main/sbbs/-/issues/724#note_4981

    I just tried this with my BBS. I logged in and read a message with DDMsgReader, then closed SyncTerm, and within a couple seconds, my BBS said I was offline..
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Eric Oulashin@1:103/705 to GitLab note in main/sbbs on Monday, February 26, 2024 21:44:21
    https://gitlab.synchro.net/main/sbbs/-/issues/724#note_4982

    Checking user.online seems to help. I've made updates to DDMsgReader.js so far, as well as dd_lightbar_menu.js, though it doesn't seem to be working quite as well in dd_lightbar_menu.js. I'll need to keep looking into this.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to GitLab note in main/sbbs on Monday, February 26, 2024 21:56:51
    https://gitlab.synchro.net/main/sbbs/-/issues/724#note_4983

    So, in the current sbbs code, it'll take 10 "operation callbacks" while disconnected before a script will be auto-terminated due to disconnection. Usually, there's one operation callback per function call you make in your script (as well as branches/loops, etc.).

    If you call sleep() for a long period of time or call some other function with a long timeout that doesn't return when the user disconnects, you'd have to do that 10 times (after disconnection) before sbbs would auto-terminate the script. Most (all?) input functions should return immediately if the user has disconnected, regardless of the timeout value you pass.

    So I'm curious what kind of "user input" loop you're using that's not quickly-auto-terminating upon disconnect.

    I'd like to get to the root-cause of this without just adding lots of `bbs.online` checks. There's something else afoot here that I'd like to get to the bottom of.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to GitLab note in main/sbbs on Monday, February 26, 2024 22:46:51
    https://gitlab.synchro.net/main/sbbs/-/issues/724#note_4985

    I'm hoping commit a474017fb7c will address this.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Nigel Reed@1:103/705 to GitLab note in main/sbbs on Monday, February 26, 2024 22:56:51
    https://gitlab.synchro.net/main/sbbs/-/issues/724#note_4987

    Confirmed this commit fixed the issue. Thank you.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Nigel Reed@1:103/705 to GitLab issue in main/sbbs on Monday, February 26, 2024 22:56:51
    close https://gitlab.synchro.net/main/sbbs/-/issues/724
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Eric Oulashin@1:103/705 to GitLab note in main/sbbs on Tuesday, February 27, 2024 09:22:14
    https://gitlab.synchro.net/main/sbbs/-/issues/724#note_4989

    Typically, I have loops with a boolean variable that can be set to false when the user chooses to quit, etc.. DDMsgReader doesn't call sleep(), and for input, in many places it uses a 30-second timeout. I didn't think I was doing anything really unique that would cause this to happen, so I'm not sure what may be causing this.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to GitLab note in main/sbbs on Tuesday, February 27, 2024 12:59:18
    https://gitlab.synchro.net/main/sbbs/-/issues/724#note_4996

    A 30 second timeout for a call to inkey() is a bit unique (large value), but should not have been a problem. However, inkey() would not return for the full timeout duration after a user disconnected and this was the bug. It would take 10 x 30 seconds (5 minutes) before the script could be auto-terminated in that case. This is now fixed in sbbs (inkey() will return immediately if a user/socket is disconnected).
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)