Skip to content

All the warnings are either "fire once" or "unlimited" based on the flag passed to last "create" method #88

@IMalyugin

Description

@IMalyugin

Basically, due to this piece of code:

Object.assign(opts, { unlimited })

The last created warning decides wether all the created warnings are limited or unlimited. Thus in fastify, since last created warning is made unlimited:
https://github.com/fastify/fastify/blob/99a405a4e347629595ac5062c74d91675b1b34e5/lib/warnings.js#L58

warning.create('FastifyWarning', 'FSTWRN002', 'The %s plugin being registered mixes async and callback styles, which will result in an error in `fastify@5`', { unlimited: true })

All the declared warnings are spamming the application :)

Should either move opts inside "create" or add a new hashmap for the unlimited flag

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions