getodk / getodk/web-forms

Secondary instances aren't reloaded when filling out the form again

Open
#861 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
38
Forks
22
PR merge metrics
No merged PRs in 30d

Description

### Expected Behaviour

If you submit a form which updates one of its own secondary instances then go to fill it in again I expect the secondary instance to now be the updated version.

### Observed Behaviour

The secondary instance isn't updated until you refresh the page.

### Reproduction Steps

Form (XML or XLSX file): https://docs.google.com/spreadsheets/d/1poe2lx_MUzbN0ySuZlRX8_fuKqM4LdsBMwKORQW1QRk/edit?gid=1068911091#gid=1068911091

Steps:
1. Fill in the form to register a new person
2. Submit
3. Click "fill out again"
4. Search for your new person but they're not there

### Additional Context

This is because secondary instances are treated as immutable. They are fetched on form load and stored in the form's definition which is never updated. This was probably true once upon a time but with entities this is no longer the case.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing the form-load and “fill out again” flow, focusing on where secondary instances are fetched and stored in the form definition. Reproduce the issue with the linked form, then verify that an updated person appears after submission without a page refresh.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.