Project

General

Profile

Actions

Bug #5542

open

/timer off seems not closing a timer correctly

Added by westor (GR) 3 months ago. Updated 3 months ago.

Status:
Assigned
Priority:
Normal
Assignee:
Category:
Scripting
Target version:
Start date:
04/12/2022
Due date:
% Done:

0%

Estimated time:
Operative System:
All
Regression:
No

Description

Hello,

I just saw that /timerNAME off doesn't closing that timer correctly.

Reproduce Code :


; Execute "/start_test ANYTHING" and then check that it keeps triggering more than 1 time the /check command, as it should only trigger that 1 time.

alias start_test {
  echo -s /start_test: $1

  var %md5 = $md5($1,0)

  .timer[ONE_ $+ %md5 $+ _TEST] 0 10 check $1

  sockclose test
  sockopen -e test google.com 443
}

alias check {
  echo -s /check: $1

  var %md5 = $md5($1,0)

  .timer[ONE_ $+ %md5 $+ _TEST] off

  if ($sock(test)) { .timer[ONE_ $+ %md5 $+ _TEST] 0 10 check $1 | cmd $1 status | return }

  echo -s Socket test is closed.
}

alias cmd { echo -a /cmd: $1 }

- Thanks!


Files

AdiIRC_2022-04-12_15-08-01.png (62.7 KB) AdiIRC_2022-04-12_15-08-01.png AdiIRC output (3 times /check called) westor (GR), 04/12/2022 02:11 PM
AdiIRC_2022-04-12_15-08-01.png (62.7 KB) AdiIRC_2022-04-12_15-08-01.png AdiIRC output (3 times /check called) westor (GR), 04/12/2022 02:12 PM
mirc_2022-04-12_15-09-30.png (12 KB) mirc_2022-04-12_15-09-30.png mIRC output (3 times /check called) westor (GR), 04/12/2022 02:13 PM
Actions #1

Updated by Per Amundsen 3 months ago

  • Status changed from New to Invalid

It works as expected, you are starting the timer again because $sock(test) is $true on multiple /check triggers.

Please verify there is an actual adiirc bug before reporting.

Updated by westor (GR) 3 months ago

This is a bug on AdiIRC and i am 100% sure about my report, when i coming here to report everytime i testing and comparing with mirc to validate that is equal, and here is not. it seems the /timer doesn't get closed when it forced to close.

Check in AdiIRC the timestamps (milliseconds) and see that the /timer there is never being closed and re-triggers.

A shorter and maybe a better examples:

; Execute > /start_test3
alias start_test3 {
  if ($fromeditbox) { set -e %start_test3 0 }

  echo -stg called $ctimer for $ord(%start_test3) time

  inc -e %start_test3 1

  timerfoo off
  timerfoo 0 1 start_test3 $rand(1,99999)
}

Or this one:

alias start_test {
  echo -st /start_test

  echo -st /start_test > starting the check timer.
  .timer[ONE_TESTING_TIMER] 0 10 check

  sockclose test
  sockopen -e test google.com 443
}

alias check {
  echo -st /check

  echo -st /check > closing the [ONE_TESTING_TIMER]
  .timer[ONE_TESTING_TIMER] off

  if ($sock(test)) {
    echo -st /check > creating [ONE_TESTING_TIMER]
    .timer[ONE_TESTING_TIMER] 0 10 check

    echo -st /check > executing /cmd
    cmd 

    return
  }

  echo -st Socket test is closed.
}

alias cmd { echo -at /cmd }

And an example without sockets

alias start_test {
  echo -st /start_test > start

  echo -st /start_test > starting [ONE_TESTING_TIMER]
  .timer[ONE_TESTING_TIMER] 0 10 check

  set -e %test 1
}

alias check {
  echo -st /check > start

  echo -st /check > closing [ONE_TESTING_TIMER]
  .timer[ONE_TESTING_TIMER] off

  if (%test) {
    echo -st /check > creating [ONE_TESTING_TIMER]
    .timer[ONE_TESTING_TIMER] 0 10 check

    echo -st /check > executing /cmd
    cmd 

    return
  }

  echo -st /check > end
}

alias cmd { echo -at /cmd > called }
Actions #4

Updated by Per Amundsen 3 months ago

mirc has been doing about 100 timer triggers now which is expected since "if (%test)" is always $true and restarts the timer, make sure you are testing in a clean version of both adiirc and mirc.

Actions #5

Updated by westor (GR) 3 months ago

Lets focus on the smallest testing code.

Bug: If you run the alias ( /start_test3 ) and count up to 10 using your hand fingers ( 1 2 3 4 5 6 7 8 9 10 ) then you suppose to get 10 echo lines ONLY, in AdiIRC you keep getting more than 10 echo lines, so this means that " timerfoo off " when the alias is being called again is not actually closing that timer, this is the actual bug in my whole report, if you test that on mIRC and try to compare then you will see the output differs, maroon was able to reproduce the bug, maybe he can explain it better, but the bug is obviously there that /timer doesn't closing the timer before re-create it.

Test code:

; Execute > /start_test3
alias start_test3 {
  if ($fromeditbox) { set -e %start_test3 0 }

  echo -stg called $ctimer $iif($1,with $1 random number) for $ord(%start_test3) time

  inc -e %start_test3 1

  timerfoo off
  timerfoo 0 1 start_test3 $rand(1,99999)
}

Actions #6

Updated by Per Amundsen 3 months ago

  • Status changed from Invalid to Assigned

maroon gave an example that works.

Actions

Also available in: Atom PDF