mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-19 18:04:25 -05:00
Because we now[1] store info about each file upload separately in the session the session isn’t overridden every time you upload a file. This is good because you can do multiple file uploads idempotently. Generally we are cleaning up after ourselves because we pop anything to do with that upload from the session. However there is an edge case: if you never send the file then the info about the file stays in the session in perpetuity[2]. This is generally happening when people are uploading files that are impossible to send, ie ones that have errors. So this commit makes two changes: 1. remove info about a file upload from the session as soon as we know that it contains errors 2. `POST` reuploads to the same endpoint as initial uploads because otherwise we need to keep info about bad uploads in the session, which would prevent us from doing 1. 1. https://github.com/alphagov/notifications-admin/pull/1968 2. or at least until the session is cleared by the user logging out
3.8 KiB
3.8 KiB