A rule written with `Require.filter` inside a contract group keyed `data`, `params` or `softCheck` loses its data type

Open
#1,218 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript

Research direction

Start with src/services/serviceContract.ts, especially RuleData and the group types, and trace how inline Require.filter rules are typed in groups keyed data, params, or softCheck. Compare that with a group using another key and with the authorizer restriction. Decide whether those keys should be refused or the type should be corrected; done means the behavior is resolved and the rule's data type is checked.

Written by the indexing model from the issue text.

Description

A contract group may be keyed data, params or softCheck, since those keys are only told from a part of an entry by what is inside them. In such a group, an entry whose rule is written in place as Require.filter(() => ({ id: 1 })) has its data type become any, so what the operation hands the rule is not checked. In a group with another key the same rule keeps its type.

No contract keys a group so today. The question is whether those three keys should be refused for groups, as authorizer is, or the type should be mended.

Found in the review of #1189, and it is the same before it.

Where: src/services/serviceContract.ts (RuleData, the group types).

Dominant language
TypeScript
Stars
11
Forks
2
PR merge metrics
No merged PRs in 30d

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No 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.

More from vevcom/project-next

All issues in vevcom/project-next

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.