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

Backend should return dataElements in timestamp order #2226

Closed
Tracked by #2137
danielskovli opened this issue Jul 10, 2024 · 4 comments
Closed
Tracked by #2137

Backend should return dataElements in timestamp order #2226

danielskovli opened this issue Jul 10, 2024 · 4 comments
Assignees

Comments

@danielskovli
Copy link
Contributor

danielskovli commented Jul 10, 2024

InstancesController.Get returns an instance object containing a data property. This property is an array of objects, in seemingly random order.

To be fair, the order is consistent between reloads, but otherwise completely useless.

We wish for the order of this list to be based on the timestamp when the associated dataElement was created, in ascending order.

@danielskovli
Copy link
Contributor Author

This has been implemented as a proposal in branch feature/subform for both app-localtest and altinn-storage.

The functionality has been verified in app-localtest, but as always the testing in altinn-storage is a bit more elusive.

@SandGrainOne Do you see any immediate concerns with the approach taken by the two commits linked above? I can't imagine this resulting in a breaking change, since we're going from pseudo-random to ordered results, but I also don't have the whole perspective on situations like these.

As for unit testing in altinn-storage, I can't even get them to run so I haven't been able to do much validation there.

@SandGrainOne
Copy link
Member

Running Storage and the integration tests require a pre configured PostgreSQL database. I can understand it's a bit of a hassle.

The change looks safe enough. Nothing I know of is sensitive to the order of data elements.

@HauklandJ
Copy link
Contributor

HauklandJ commented Aug 15, 2024

Running Storage and the integration tests require a pre configured PostgreSQL database. I can understand it's a bit of a hassle.

@SandGrainOne What needs to be configured? Does anything need to be populated in the DB for the tests to run? Is there a setup guide somewhere?

@SandGrainOne
Copy link
Member

@HauklandJ Start with the readme: https://github.com/Altinn/altinn-storage/#setting-up-postgresql

The setup guide we have is for Events, but the pattern is identical. All use of events should be replaced with storage. E.g eventsdb becomes storagedb and so on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

3 participants