Interval selector does not raise a run-time error for invalid intervals (start after end)
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 52/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- javascript
調査の方向性
Start with src/elm/interval.ts and src/datatypes/interval.ts, which the issue identifies as the evaluation and construction paths. Read how interval bounds and open-bound successors or predecessors are handled, then find the tests for interval construction and execution. Done means invalid effective bounds raise a run-time error, while null bounds retain their stated semantics.
索引モデルが issue の本文から書いたものです。
説明
Summary
The CQL specification says that constructing an invalid interval is a run-time error. cql-execution builds such intervals without any error, and operators applied to them then return values computed from the reversed bounds.
Specification
Author's Guide, Interval Values (same text in CQL 1.5.3 and 2.0.0):
Note that the ending boundary must be greater than or equal to the starting boundary to construct a valid interval. Attempting to specify an invalid Interval will result in a run-time error.
The examples given there are Interval[1, -1] and Interval[1, 1).
Reproduction
ELM was produced with the reference translator (@cqframework/cql 5.8.0, cql-to-elm), and the expressions were evaluated with PatientContext and an empty patient.
library InvalidIntervalRepro version '1.0.0'
define "Reversed": Interval[5, 1]
define "ClosedOpenUnit": Interval[1, 1)
define "InReversed": 3 in Interval[5, 1]
define "StartOfReversed": start of Interval[5, 1]
define "ReversedDateTime": Interval[@2024-01-02T00:00:00.000Z, @2024-01-01T00:00:00.000Z]
define "EndPointOfReversed": @2024-01-01T00:00:00.000Z in Interval[@2024-01-02T00:00:00.000Z, @2024-01-01T00:00:00.000Z]
| Expression | cql-execution 3.3.2 | cql-execution 4.0.0-beta.1 | Expected (spec) |
|---|---|---|---|
Reversed |
[5, 1] |
[5, 1] |
run-time error |
ClosedOpenUnit |
[1, 1) |
[1, 1) |
run-time error |
InReversed |
false |
false |
run-time error |
StartOfReversed |
5 |
5 |
run-time error |
ReversedDateTime |
interval returned | interval returned | run-time error |
EndPointOfReversed |
true |
false |
run-time error |
For comparison, the JavaScript build of the reference engine (@cqframework/cql 5.8.0) raises an error for all six, for example Invalid Interval - the ending boundary (1) must be greater than or equal to the starting boundary (5).
The literal cases above are only the smallest reproduction. In practice the bounds usually come from data, as in Interval[A, B]. When A is after B, a membership test returns true or false instead of failing, so a data quality problem goes unnoticed. The result also differs between 3.3.2 and 4.0.0-beta.1, as the EndPointOfReversed row shows.
Where
On master (e87e3fa8a3), neither Interval.exec() in src/elm/interval.ts nor the constructor in src/datatypes/interval.ts compares the bounds.
A check would need to:
- compare the effective start and end, taking the successor of an open low bound and the predecessor of an open high bound, so that
Interval[1, 1)is rejected; - skip null bounds, which have their own semantics (boundless or unknown).
Environment
- Node.js 24.15.0
- cql-execution 3.3.2 and 4.0.0-beta.1
- ELM from
@cqframework/cql5.8.0
- 主要言語
- JavaScript
- スター
- 86
- フォーク
- 40
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
cqframework/cql-execution のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
cqframework/cql-execution#410 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
cqframework/cql-execution#407 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
cqframework/cql-execution#406 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
cqframework/cql-execution#414 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
cqframework/cql-execution#413 ·
cqframework/cql-execution の issue をすべて見る
似ている issue
-
Mend: dependency security vulnerability
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
ManageIQ/manageiq-ui-service#2259 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
electerious/Ackee#411 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
babalae/bettergi-scripts-list#3905 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[Bug] "Configure Colota" opens Colota with "Invalid configuration: No configuration data in URL"オープン
難易度 1/5 1〜3時間 初心者へのやさしさ 87/100
dedicatedcode/reitti#1445 ·
メンテナーはふだん 1 日以内に返信