Enhancement: Add validation for unique values for a short text fields#1770
Conversation
4bcc937 to
8f0684a
Compare
blizzz
left a comment
There was a problem hiding this comment.
Didn't test yet, so far looks good, left minor requests.
However, existing tests seem to be failing. Having additional tests, integration, e2e or both would be appreciated.
8f0684a to
12a33b3
Compare
276e95d to
7a20c4b
Compare
|
@blizzz I've updated PR and 1st message including screenshoots. Now we have user-friendly error message with an explanation why row wasn't added. Old tests should pass. Also I'm trying to add new integration tests here. If anybody can help me with that - welcome |
a3d3049 to
adf32d1
Compare
|
@blizzz Old tests fixed. Also there is 1 integration test for a new functionality |
blizzz
left a comment
There was a problem hiding this comment.
A few questions.
I did a little bit of smoke testing, and it looks good so far 👍
Three more points I like to raise from this review:
- There is one corner case though: when you have a column with non-unique values, but edit the column and set it to unique, then it works. But obviously the content there is not unique, but new values will be checked for it.
Is this intentional behaviour? An alternative would be to reject the change with the error that the column values are not unique.
-
Another thought came up about the return status code. You set it to 400, which is OK, I am thinking 409 could maybe be more precise. But maybe this is also bike shedding 🤔
-
When you try to update a row to have a duplicated value, the operations fails , but with status code 500 instead of 400. This should be sorted out.
I hope I've covered all points now 🙇 Thank you for the work on this feature!
|
@blizzz thank you for code review and deep testing 🫶 . I'm going to fix your finding later today |
36f6088 to
52d3fab
Compare
|
hey @blizzz!
Yeah, this is expected behavior. We can improve it later, but as you can see - current PR already huge.
|
35cd347 to
0f62241
Compare
0f62241 to
3a9c5bc
Compare
|
rebased. Almost green |
|
seems like we have same error in other PRs: https://github.com/nextcloud/tables/actions/runs/15216779497/job/42804024347 |
3a9c5bc to
4cf6dca
Compare
26a11d8 to
119e66b
Compare
119e66b to
6822509
Compare
|
@blizzz code review comments fixed |
17dcf17 to
b90b1a5
Compare
00ba5eb to
8472363
Compare
|
@blizzz Good to merge? |
Signed-off-by: Kostiantyn Miakshyn <molodchick@gmail.com>
Signed-off-by: Kostiantyn Miakshyn <molodchick@gmail.com>
8472363 to
5cfb26a
Compare

This PR adds new toggle that validates short text fields for unique values. Closes #660
🔍 Preview
Trying to insert row with value that already present in table
