Skip to content

Check if the Elixir Library Guidelines are followed #2

@ejpcmac

Description

@ejpcmac

Check for each anti-pattern in the Elixir Library Guidelines.

Anti-patterns

Exceptions used for control flow

Currently, the setup!/0, clear!/0 and drop!/0 in the Helpers module only permit to use exceptions. They are used only in the Mix tasks, but could be also used by a user. This should be enhanced in a next version. Maybe these functions should be undocumented or the control flow changed in the Mix tasks.

Application configuration

plug_session_mnesia is currently configured via the application environment. This is discouraged by the guidelines.

Doing any configuration in the plug initialisation is however a bad idea too: the configuration is then frozen at compile time. Plus, plug_session_mnesia is an application, with running processes like the session cleaner.

The main question regarding this kind of configuration is: what should we do if some user wants two webservers with different plug_session_mnesia configurations?

An idea could be to replace the application by a supervisor accepting the configuration as an argument to its init function. But how should we pass this configuration to the session store?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions