Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New PATCH endpoint on DataController to both save changes and run validation #383

Closed
ivarne opened this issue Dec 20, 2023 · 0 comments
Closed
Assignees
Labels
area/validation Custom validations/validation messages fe-v4 Issues required for app-frontend v4 to be shippable
Milestone

Comments

@ivarne
Copy link
Member

ivarne commented Dec 20, 2023

For continuous validation on all save operations we need a new endpoint that both saves and runs relevant validations so that frontend can keep an updated list of backend validation issues without running expensive validations too often.

Requirements

  • Validators must get info about what has changed, so that they can be skipped and frontend keeps the old issue list for that validator.
  • DataProcessor must get info about changes, so that expensive calculations/api calls only runs when required.

Nice to have

  • Multiple users on the same app instance does not always cause a race condition and lost data.
  • Reduce data sendt over the wire

Proposed solution

New endpoint that uses JSONPatch to describe the changes that needs to be made to the data model. This means that we first need to read the old data from storage before applying the patch and storing the updated data.

In addition we take a list of validatorId that frontend knows that it does locally, so the server kan skip running those validators (until at the last validation).
The patch can be leveraged by validators to skip running when no fields relevant to the validator has changed and the issues list should be the same as before validation.
DataProcessing gets a view of the old model so they can do comparisons if they want to save on calculation time.

@ivarne ivarne added the area/validation Custom validations/validation messages label Dec 20, 2023
@ivarne ivarne added this to the 8.0.0 milestone Dec 20, 2023
@ivarne ivarne self-assigned this Dec 20, 2023
@ivarne ivarne added this to Team Apps Dec 20, 2023
@ivarne ivarne moved this to 👷 In Progress in Team Apps Dec 20, 2023
@ivarne ivarne mentioned this issue Dec 20, 2023
5 tasks
@RonnyB71 RonnyB71 added the fe-v4 Issues required for app-frontend v4 to be shippable label Jan 2, 2024
@HanneLauritsen1967 HanneLauritsen1967 moved this from 👷 In Progress to 🔎 Review in Team Apps Jan 23, 2024
@HanneLauritsen1967 HanneLauritsen1967 moved this from 🔎 Review to ✅ Done in Team Apps Jan 26, 2024
@tjololo tjololo closed this as completed Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/validation Custom validations/validation messages fe-v4 Issues required for app-frontend v4 to be shippable
Projects
Archived in project
Development

No branches or pull requests

3 participants