restify / restify/node-restify

Audit log timer values should accumulate not overwrite

Open
#1,435 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug Critical Waiting on Response
Dominant language
JavaScript
Stars
10.7k
Forks
975
Avg merge
1d 6h
Merged PRs (30d)
5

Description

Bug Report

Restify Version

5.x

Node.js Version

6.x

Expected behaviour

Audit log timers should accumulate their value when startHandlerTimer/endHandlerTimer is called more than once for the same timer name.

Actual behaviour

Audit log timer is overwritten.

Repro case

See test in #1443.

Cause

https://github.com/restify/node-restify/blob/5169db7b1d2c9979e534b2c27912f5be398bcbca/lib/plugins/audit.js#L85-L90

Are you willing and able to fix this?

Yes.

Contributor guide

Open the contributing guide

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.

Research direction

Start with lib/plugins/audit.js at the linked lines 85-90 and review the test referenced in issue #1443. Reproduce repeated startHandlerTimer/endHandlerTimer calls for one timer name, then verify the audit log accumulates the values rather than overwriting them.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
api, backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.