Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unrecoverable error in case of recursion in asyncapi document #1100

Open
catosaurusrex2003 opened this issue Oct 22, 2024 · 2 comments
Open

Comments

@catosaurusrex2003
Copy link
Contributor

Description
As described in this issue asyncapi/studio#771

when a document has got recursion in it

the rendering crashes due to too many recursion.

This causes the app to go into unrecoverable error.

Steps to reproduce:

  1. go to https://studio.asyncapi.com
  2. paste
asyncapi: 3.0.0
info:
  title: Account Service
  version: 1.0.0
  description: This service is in charge of processing user signups
channels:
  user/signedup:
    address: user/signedup
    messages:
      subscribe.message:
        $ref: '#/components/messages/TradeMessageServer'

components:
  messages:
    TradeMessageServer:
      name: Trade Message (server)
      title: Trade Message (server)
      description: A message containing trade data
      x-something: 
        $ref: '#/components/messages/TradeMessageServer' #RECURSION IS HAPPENING HERE !!! 

image
the error in console
image

Now Since studio fetches the document from localstorage before loading. Even if you reload the site it keeps on crashing again and again. Only way to recover is to clear the localstorage and start again with all the progress lost.

Expected result
Application should not crash into an unrecoverable state.

The problem is in the recursion found in this function which doesnt have a recursion limit

Related Issues:
asyncapi/studio#771

@catosaurusrex2003 catosaurusrex2003 changed the title Application crashes in case of Recursion in asyncapi document. unrecoverable error in case of recursion in asyncapi document Oct 22, 2024
@reachaadrika
Copy link

@AceTheCreator can I pick this for Level 1 Review ?

@catosaurusrex2003
Copy link
Contributor Author

the Prs #1108 and #1101 are very related

#1108 is responsible for actually rendering the error message. But for the internal errors the message might differ from browser to browser

#1101 is responsible to detect recursion using weakset and throw a more helpful error message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants