Wire ISO post: has() accepts text values such as an empty string, true or 0x1A for wire numbers

Open Beginner friendly
#3,265 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
javascript
Domain
tooling

Research direction

Start in assets/posts/wire-iso.cps at the has() helper and the wire-parameter validation that calls JS isFinite. Replace the coercion-based check with typeof value !== "number" || !isFinite(value) and refuse the offending parameter by name. Then remove the duplicate "an angle-word taper needs one stated angle" message when the first refusal already names the cause. Add tests for "", true, 0x1A, a bad WirePlane, and a good section after a refused one; done when those pass and refusals name the parameter.

Written by the indexing model from the issue text.

Description

area:post effort:low enhancement P7 source:agent

Found in the two safety reads of PR #3263 (comments 7071252890 and 7071263058). This behaviour is older than that PR.

has() in assets/posts/wire-iso.cps uses the JS isFinite, which converts its argument first. A hand-written stream with PARAM WireU "" posts U0., true posts U1., and 0x1A posts U26.. The app never writes such values. The stream parser turns each real number into a number, so a text value for a wire parameter is always bad.

Expected: for the wire parameters, check typeof value !== "number" || !isFinite(value) and refuse the value by name. Add a test for each of the three examples.

Also: a null WireTaper on an angle-word machine gives a second message, "an angle-word taper needs one stated angle". Remove that second message when the first refusal already names the cause. The new test of PR #3263 does not cover a bad WirePlane or a good section after a refused one. Add those two cases.

Dominant language
Rust
Stars
8
Forks
11
Avg merge
8h 12m
Merged PRs (30d)
928

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 NeoTech/Camcraft

All issues in NeoTech/Camcraft

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.