open-forms icon indicating copy to clipboard operation
open-forms copied to clipboard

Rethink SubmissionState and SubmissionValueVariablesState

Open CharString opened this issue 1 year ago • 6 comments

Thema / Theme

Other

Omschrijving / Description

SubmissionState and SubmissionValueVariablesState are "cache" classes that optimize read access to the database during API calls like "Store submission step data" and "Apply/check form logic". Their current implementation has grown to be a bit problematic.

Invalidation of these states isn't handled correctly and since references to them (and their innards) are copied, we might bump into more bugs like #3114

One short sighted possible solution for SubmissionState is have forms_steps and submission_steps not be of List, but of Sequence that has implementations of that protocol that check cache staleness.

Added value / Toegevoegde waarde

No response

Aanvullende opmerkingen / Additional context

No response

CharString avatar Jun 13 '23 09:06 CharString