million-views/praas

Ensure curi is unique

Closed this issue · 2 comments

  • Functionality need to be built
  • Add a unit test

Note
Earlier commit history shows that curi was generated automatically in create curi. Then later it was moved to model.
The model had the test to check duplicate curi. which was removed during nanoid module update.

5r1n1 commented
  • Curi is auto generated based on a 5 digit random alphabet picked from 33 symbols
  • So, possible different values of curi would be 5P33 = approx 2.85 million
  • Currently any error during conduit generation is sent back to caller
  • Instead, the error needs to be checked and in case it is a SQL Validation Error (duplicate curi), the curi needs to be regenerated
5r1n1 commented
  • Unit test could not be added as curi is generated automatically before conduit is saved
  • However, tests were run after forcing code change to generate duplicate curi to ensure the eventuality is handled if ever occurs