envelop icon indicating copy to clipboard operation
envelop copied to clipboard

useDisableIntrospection - Dynamic enable/disable of introspection is not working

Open aylesm opened this issue 2 years ago • 2 comments

Hi,

I've been using useDisableIntrospection to disable introspection and only expose if a header value is passed to the server. This works correctly 1st time. But if I add or remove the header the disableif is called correctly. Looking at the source code there is no mechanism to remove the previous enable/disable and push the new validation rule. So if you start off disabled you stay disabled. Or vice-versa.

Issue workflow progress

Progress of the issue based on the Contributor Workflow

  • [ ] 1. The issue provides a minimal reproduction available on Stackblitz.
    • Please install the latest @envelop/* packages that you are using.
    • Please make sure the reproduction is as small as possible.
  • [ ] 2. A failing test has been provided
  • [ ] 3. A local solution has been provided
  • [ ] 4. A pull request is pending review

Describe the bug

To Reproduce Steps to reproduce the behavior:

Expected behavior

Environment:

  • OS:
  • NodeJS:
  • @envelop/* versions:
    • @envelop/core: ???

Additional context

aylesm avatar Jun 15 '22 19:06 aylesm

can you provide a codesandbox for this?

saihaj avatar Jun 15 '22 21:06 saihaj

Hey @aylesm, can you please provide a reproduction? Are you sure you call getEnveloped for each incoming request separately?

n1ru4l avatar Jun 19 '22 09:06 n1ru4l

file a new issue with reproduction

saihaj avatar Sep 01 '22 18:09 saihaj