← Contributions Open-source contribution

Nocturne

Making an API’s echo response describe the query it actually runs, with regression tests around the edge cases.

Context
Upstream contributions to nightscout/nocturne, merged in October 2026.
Stack
C#, .NET, API behavior and regression tests.
Role
Contributor: query parsing fix, API capability reporting correction and test-infrastructure cleanup.
Status
PR #2267 merged 20 Oct; PRs #2120 and #2163 merged 18 Oct 2026. Merge status is not a claim about a particular deployed release.
01

The mismatch

The /api/v1/times/echo endpoint exposes a request and its query interpretation. That interpretation needs to agree with the filters used by the time-query endpoints, rather than treating the raw request parameters as search conditions.

My change routes the echo query through the same BuildFind path as /times and /slice. It parses find[...] filters into the query while retaining the original request separately.

02

The regression coverage

PR #2267 includes regression coverage for equivalent entry queries, repeated parameters, regular expressions and unknown operators. The focus is consistency between query paths, including inputs that are easy to lose when translating a raw request.

This is not a credential-redaction fix: token and secret parameters remain in req.query. They are excluded from the parsed search conditions, not removed from the echoed request.

GitHub · Merged 20 Oct 2026PR #2267: time-query echo parsing and regression testsOpen ↗
03

Related merged work

API capability reporting. PR #2120 corrects the status response to advertise existing v2 API support, with an updated test. It does not introduce a new v2 API.

GitHub · Merged 18 Oct 2026PR #2120: accurate v2 capability reportingOpen ↗

Shared test infrastructure. PR #2163 reuses EchoingProblemDetailsFactory across three test classes. This is test-only cleanup, not a production behavior change.

GitHub · Merged 18 Oct 2026PR #2163: reuse the shared test factoryOpen ↗