Skip to content

fix: remove leftover debug logging from client methods - #37

Merged
MaheshkumarSundaram merged 1 commit into
bpmnServer:masterfrom
MaheshkumarSundaram:fix/remove-debug-logging
Aug 19, 2026
Merged

fix: remove leftover debug logging from client methods#37
MaheshkumarSundaram merged 1 commit into
bpmnServer:masterfrom
MaheshkumarSundaram:fix/remove-debug-logging

Conversation

@MaheshkumarSundaram

Copy link
Copy Markdown
Collaborator

Problem

Several client methods write to console.log unconditionally on their success
paths, with no way for a consuming application to turn it off. The most disruptive is
ClientDefinitions.load(), which dumps the entire response:

async load(name): Promise<IDefinitionData> {
    const res = await this.client.get(encodeURI('definitions/load/' + name), { name });
    if (res['errors']) { ... }
    console.log(res);          // <-- prints the whole definition
    return res as IDefinitionData;
}

The server answers /definitions/load/:name with the model source, so every call
prints a complete BPMN XML document — diagram interchange markup included — to the
host application's stdout.

In our case definitions.load() sits behind a screen where users pick a workflow to
view, so a full BPMN document is printed to the server log on every selection. It
buries real log output, and on a busy day it is a meaningful amount of disk.

The same pattern appears in delete() and rename() (bare console.log(res)), in
engine.invoke() and engine.restart() (console.log('invoke', options) — note
restart reports itself as invoke), in definitions.import(), and in
WebService.upload(), which logs the status and full body of every upload response.

These look like debugging aids that were not removed before release rather than
intentional diagnostics: they are unlabelled, unconditional, and print raw objects.

Change

Removes debug logging from success paths only:

File Method Removed
src/BPMNClient.ts ClientEngine.invoke console.log('invoke', options)
src/BPMNClient.ts ClientEngine.restart console.log('invoke', options)
src/BPMNClient.ts ClientDefinitions.import console.log('import ', …) and console.log('import done ', res)
src/BPMNClient.ts ClientDefinitions.load console.log(res)
src/BPMNClient.ts ClientDefinitions.delete console.log(res)
src/BPMNClient.ts ClientDefinitions.rename console.log(res)
src/BPMNClient2.ts the same six, which are duplicated in this class
src/WebService.ts upload console.log('Response Status:', response.status, response.data)

Error-path logging is left untouched. Every console.log(res['errors']) and the
catch blocks in WebService are unchanged, so nothing that helps diagnose a failure
is lost. The only behaviour change is that successful calls are quiet.

No signatures, return values or control flow change. tsc --noEmit reports no new
errors against the baseline.

Testing

  • npx tsc --noEmit — no new errors versus baseline.
  • node --check on each modified dist file.
  • Exercised against a live server: definitions.load, engine.invoke and
    definitions.import all return identical values with no stdout output; error paths
    still log and throw as before.

@MaheshkumarSundaram MaheshkumarSundaram added the enhancement New feature or request label Aug 18, 2026
@MaheshkumarSundaram
MaheshkumarSundaram merged commit 96a6914 into bpmnServer:master Aug 19, 2026
@MaheshkumarSundaram
MaheshkumarSundaram deleted the fix/remove-debug-logging branch August 19, 2026 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants