Improve saving state
- Dominant language
- Scala
- Stars
- 301
- Forks
- 76
- PR merge metrics
- No merged PRs in 30d
Description
**Motivation**
We could improve both readability and performance when saving states by getting rid of the preliminary select.
**Acceptance criteria**
By applying the following approach (we gain one roundtrip to the database):
* if tag is Latest and rev == 1: INSERT command
* if tag is Latest and rev >1: UPDATE command
* If tag is a custom tag: INSERT command with a ON CONFLICT clause
Contributor guide
Research direction
Locate the state-saving implementation and identify the preliminary database select and existing revision/tag handling. Verify the INSERT, UPDATE, and ON CONFLICT paths against the acceptance criteria, then confirm that saving a state uses one fewer database roundtrip.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala, sql
- Domain
- backend, database
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100