Added ADR for not-found visits tracking

This commit is contained in:
Alejandro Celaya 2021-02-07 10:56:22 +01:00
parent 4d5dd8c8de
commit a1fb44f2a6
2 changed files with 34 additions and 0 deletions

View file

@ -0,0 +1,33 @@
# Track visits to 'base_url', 'invalid_short_url' and 'regular_404'
* Status: Accepted
* Date: 2021-02-07
## Context and problem statement
Shlink has the mechanism to return either custom errors or custom redirects when visiting the instance's base URL, an invalid short URL, or any other kind of URL that would result in a "Not found" error.
However, it does not track visits to any of those, just to valid short URLs.
The intention is to change that, and allow users to track the cases mentioned above.
## Considered option
* Create a new table to track visits o this kind.
* Reuse the existing `visits` table, by making `short_url_id` nullable and adding a couple of other fields.
## Decision outcome
*TBD*
## Pros and Cons of the Options
### New table
* Good because we don't touch existing models and tables, reducing the risk to introduce a backwards compatibility break.
* Bad because we will have to repeat data modeling and logic, or refactor some components to support both contexts. This in turn increases the options to introduce a BC break.
### Reuse existing table
* Good because all the mechanisms in place to handle visits will work out of the box, including locating visits and such.
* Bad because we will have more optional properties, which means more double checks in many places.

View file

@ -2,4 +2,5 @@
Here listed you will find the different architectural decisions taken in the project, including all the reasoning behind it, options considered, and final outcome.
* [2021-02-07 Track visits to 'base_url', 'invalid_short_url' and 'regular_404'](2021-02-07-track-visits-to-base-url-invalid-short-url-and-regular-404.md)
* [2021-01-17 Support restrictions and permissions in API keys](2021-01-17-support-restrictions-and-permissions-in-api-keys.md)