minvws / nl-kat-coordination

Repo nl-kat-coordination for minvws
European Union Public License 1.2
122 stars 55 forks source link

Replace Django Messaging #3190

Open madelondohmen opened 1 month ago

madelondohmen commented 1 month ago

About this feature

Detailed description

In a lot of places we use Django messaging. We have to think about replacing this.

Feature benefit/User story

Please also explain why this feature is important or necessary. What benefit does it bring to users? If possible, provide a user story format:

As a [type of user], I want to [action] so that [benefit].

Specifications

Please add some specifications for the implementation. What needs to be implemented to match the design?

The implementation should include…

Additional information

Any additional information, considerations, or context that might be helpful for understanding or evaluating the feature request.

Implementation

This part should only be filled in by the developers.

Possible solution

Outline your proposed solution for implementing the feature. You can include any specific ideas, designs, or functionalities here.

Alternatives considered

Describe any alternative approaches or solutions you've considered, and why you believe the proposed solution is superior.

underdarknl commented 1 month ago

Messaging is a lazy way to pushing 'errors' on the stack, and hopefully show them on the next page. This comes in handy when the user is active on View A, fills out a form (for example), View B handles the form submission, wants to message the user, but also Redirects the user to view C (or back to A). This redirection is what you'd want to do, to avoid issues with the user refreshing the page, thus resubmitting his form data and re-triggering the already triggered action. However, pushing messages onto a session is not restful, and can leads to unwanted side-effects where the are displayed not on page C, but on a wildly different page because the user was doing two flows in two tabs for example.

The cleaner solution is to Redirect the user to View C, and have some pre-defined argument (error=true, succes=true) let View C know that it needs to display message X or Y.

madelondohmen commented 1 month ago

Outcome of discussion meeting (09-07-2024): Proposal 1: include in the URL the status "success/error" and a message (or just a boolean).

Proposal 2: In some places we show a message (and continue the flow) instead of showing an error page. Sometimes this should be an error page. (For example, on the "Tasks" page if the scheduler is not working or the task list on the "Objects" page.)