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

Make all URLs canonical #1143

Open
mitar opened this issue Aug 6, 2020 · 3 comments
Open

Make all URLs canonical #1143

mitar opened this issue Aug 6, 2020 · 3 comments
Assignees

Comments

@mitar
Copy link
Member

mitar commented Aug 6, 2020

We should get rid of this dual URLs, where public and private URLs are different. Let's:

  • Make all URLs look like the private URLs, so using UUIDs.
  • So in all models, we should have a UUID stored alongside the numerical primary key.
  • Primary key is still used for foreign keys.
  • But in URLs we use UUIDs.
  • UUID fields should have an index in the database.
  • We should resolve those UUIDs directly to related objects.
  • We should make that all old public URLs (numerical) redirect to UUID ones, on the backend (301 status code).
  • Any client code should be updated to use UUID based URLs everywhere.
  • Any client code for redirects should be removed.
@mitar
Copy link
Member Author

mitar commented Aug 6, 2020

@yolile This issue is something you should be doing in the future, after finishing current tasks. Before that, can you please tell how much work do you think this is and if everything above makes sense. I do not know all the details so maybe I missed something or something makes no sense or could be done simpler.

@yolile
Copy link
Contributor

yolile commented Oct 12, 2020

So in all models, we should have a UUID stored alongside the numerical primary key.
Primary key is still used for foreign keys.

This is already as that in the backend.

The major changes are in the frontend, as there is a lot of logic on what to do accordingly to the URL and if the URL has a uuid or and id on it , eg https://github.com/socialappslab/appcivist-pb-client/blob/7281ea8a1bf5b6ae8f381fd8498bb1bc166219d3/app/v2/controllers/main.js#L115

As the code in the frontend is sparse in different files I anticipate that there will be needed a lot of tests and refactoring. Therefore, I estimate around 16 to 20 hours of work

@mitar
Copy link
Member Author

mitar commented Oct 12, 2020

OK. Based on this, I would have moved this issue for you to work on. I think this is a reasonable chunk you could then do, a part this month and a part next month. So please start working on this.

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

No branches or pull requests

2 participants