divviup / divviup/divviup-api

New task form: need to reset VDAF parameters when changing VDAF type

Open
#999 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
10
Forks
5
Avg merge
2h 41m
Merged PRs (30d)
66

Description

When the vdaf.type field is changed in the new task form, we need to both clear any nested parameters that don't apply to the new VDAF, and set default values of VDAF parameters to mirror the default values of their controls. Currently, if you change the "Function" selector to "sum" and don't touch the "Measurement Range" selector, the request will only include a type within the vdaf nested object. Moreover, the API error (below) is not surfaced as a validation error in the UI.

{
	"vdaf": {
		"bits": [
			{
				"code": "required",
				"message": null,
				"params": {
					"value": null
				}
			}
		]
	}
}

Furthermore, if you change the function to "histogram", enter some histogram buckets, and then change the function to "sum", the histogram buckets will still be sent to the server in the request.

Contributor guide

No contributing guide indexed for this repository

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 by locating the new task form and the handler for changes to the vdaf.type field. Trace how control defaults and nested VDAF values are assembled into the request, then check how the shown API validation response is mapped into UI errors. Done means irrelevant parameters are cleared, applicable defaults are submitted, and VDAF validation errors appear in the form.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.