Skip to content

Add archive support, fix #1634 #1744

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

stitch
Copy link
Collaborator

@stitch stitch commented May 4, 2025

Support archived links from the dashboard and other sources.

For example, loading the report from example.nl from a few weeks ago:

http://localhost:8080/archive/mail/example.nl/2025-05-04/

This change removes a large chunk of data (millions of rows) from the dashboard as no unique ID is needed anymore to visit the correct report. This saves the unique ID every time a report is made. Additionally it is a very convenient feature for some users that use internet.nl for compliance, as they can now retrieve the last report from December with ease (if this feature is promoted).

This solves issue #1634

The sooner this can be placed into batch, the better, as we then can start cleaning up the database and keep things fast and efficient :)

@bwbroersma
Copy link
Collaborator

So this creates a new view for old reports: wouldn't it be more logical to redirect to the already existing view?
Otherwise one resource is viewable via an (almost) unbound number of URL's.

Should double check if the indices are in place for commonly tested domains / what the worst case performance is.

@stitch
Copy link
Collaborator Author

stitch commented Jun 3, 2025

I've done so in the code above.

I've changed it so that:
http://localhost:8080/archive/mail/example.nl/2025-05-04/

Redirects to:
http://localhost:8080/mail/example.nl/2/

There are pro's and cons, you decide which one is what :)

  • Using the same view (with the ID) is possible at the expense of an additional query. One for the matching ID and one for the report after the redirect. I've minimized the ID-query to only retrieve the ID.
  • In a sense it was already using the same view. But using the redirect matches the stable urls with numbers that users are already familiar with. Using the path with an ID prevents the path with a date to start becoming a separately maintained thing.
  • The redirect always removes the work of the user in the address bar, which is generally frustrating. Doing this makes the date-endpoint not a first class route. For the intended automated routes this is fine.

The /archive/ path is intentional. As it otherwise the date-input will overlap with any typo-correction in the ID-path. That would become a maintenance hog.

Using a redirect or not can still be changed afterward if the vision changes. So that would not impede adopting either solution.

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

Successfully merging this pull request may close these issues.

2 participants