Skip to content

Flash, flash & flash, the system is broken and we need some alternative #521

@fcaps

Description

@fcaps

Current status:
most of the flash messages are not working.

including some weird configurations with:

        flash.type = 'Error!'
        flash.class = 'alert-danger'
        flash.messages = [{ msg: 'The invitation link is wrong or truncated. Key informations are missing.' }]

        const buff = Buffer.from(JSON.stringify(flash))
        const data = buff.toString('base64')

        return res.redirect('/clans?flash=' + data)

there is an old flash implementation https://github.com/jaredhanson/connect-flash, but this is 10 years old and actually not used in the code, we start it with:

#AppKernel
        this.expressApp.use(flash())
        this.expressApp.use((req, res, next) => {
            res.locals.message = req.flash()
            next()
        })

but never written or used in the templates....

To stop this madness, we need a proper session-flash implementation and stop using multiple systems or structures.
No reddirest with "?flash=knhdsfapoinbgoiua", no custom made objects and template mixins.

Base Acceptance criteria:

  • if the user destroys a clan or makes any mutating action, a flash message should be saved in the session
  • on rendering a site, a flash-message should pop up

non-goals:

  • using flash messages to show validation errors

something like

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions