Waiting for keyboard unlock after an AID key has no timeout and ignores an already-locked keyboard

Open
#22 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
cpp
Domain
tooling

Research direction

Start by reading src/script_executor.cpp around lines 118–143 and 233–239, focusing on m_waitingForUnlock and the state-change signal that clears it. Reproduce with the issue’s ON TIMEOUT/PRESS ENTER example, and check PRESS SYSREQ separately. Done means the unlock wait honors EXPECT_TIMEOUT and dispatches the handler, locked AID presses fail immediately, and SysReq/Attn do not wait for unlock.

Written by the indexing model from the issue text.

Description

bug
Summary

After PRESS ENTER (or any AID) the executor waits for the keyboard to unlock with no timeout and no ON TIMEOUT handling. If the keyboard is already Locked/ErrorLocked (the widget drops the key) or the host never answers, the script hangs forever. PRESS SYSREQ also waits although SysReq does not change the keyboard state.

Location
  • File(s): src/script_executor.cpp
  • Line(s) / function(s): L118–L143, L233–L239
Category

error-handling

Severity

medium

Unattended scripts and MCP calls hang (MCP falls back to its own 60 s timeout).

Reproduction / Evidence

Reproducible at runtime: ON TIMEOUT GOTO h / GLOBAL EXPECT_TIMEOUT 300 / PRESS ENTER / … with a keyboard that never unlocks: still running after 3 s, handler never fires. Live against IBM i 7.5 through 5250ng's MCP: press_key SYSREQ → Script execution timed out after 60 seconds.

Expected Behavior

The unlock wait honours EXPECT_TIMEOUT (or its own limit) and dispatches ON TIMEOUT; pressing an AID while locked fails immediately; SysReq/Attn do not wait for an unlock.

Actual Behavior

Indefinite wait.

Root Cause

m_waitingForUnlock is only cleared by a state-change signal; no timer guards it.

Dominant language
C++
Stars
1
Forks
2
Avg merge
1h 34m
Merged PRs (30d)
7

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from 5250ng/5250script

All issues in 5250ng/5250script

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.