We currently have cases where the CFD might transition to a same state twice when restarting.
Furthermore, we might transition from `Open` to `Open` upon renewal.
Since it is currently unclear if this restriction is really needed we just print a warning in the logs instead of failing.
The problem was that the restriction on the JOIN clause does not properly filter the complete set, but actually results in wrongly joining the CFDs.
This resulted in two CFDs returned, where one was wrongly assembled (the id of the first one, but the data of the second one).
In a cases where the wrong one is the first one in the list of returned CFDs we would run into an error when inserting a new state, because we would try to alter the state of a wrong CFD.
Fixed by joining on the id and filtering for the order.uuid in the where clause.
Note:
I also tested to add the `and orders.uuid = ?` restriction to the first join clause (in addition to the id clause) which might theoretically be more optimized.
That would work as well, but I found it harder to reason about it. As part of the overall where clause one can see the restriction to exactly this value more clearly.
Vite deletes the `dist` directory on re-builds. That will also delete
the gitignore which makes the generated files show up in Git.
We need those directories to exist otherwise `rust-embed` fails.
Use a build-script to create them when we compile the daemons.
To password protect a route, we only need to add the `Authenticated`
route guard. To test that this works as expected, we can create a
dummy route in the test which makes the rocket instance easier to
construct.
By creating the `Context` first, we can obtain an address without
actually instantiating the actor. This allows us to have two actors
own a reference to each other without the use of `Option`.
A dev might have or might not have built the frontend. If he did not, a get request to `/` will result in a `HTTP::404`. If he did, the containing `index.html` will be returned leading to a `HTTP::200`.
Upcoming rollout of xtra will make instantiating an actor for test purposes much
more cumbersome. These tests don't need the actor, therefore a new route that
does not depend on instantiating one has been created.
These tests don't really add much value anymore.
They were initially added for making sure we don't break the API towards the UI, but we introduced a separate model for that in the meanwhile.
One could still argue that these tests ensure backwards compatibility for the cfd state in the DB, but that is not important at the moment.
Since we have more complex states now it is quite a pain to maintain these tests now - without getting much out.