Uploaded image for project: 'Compass '
  1. Compass
  2. COMPASS-9268

using custom sleep function depending on setTimeout crashes the compass renderer process

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • No version
    • Affects Version/s: None
    • Component/s: None
    • None
    • Environment:
      OS:
      node.js / npm versions:
      Additional info:
    • Not Needed
    • None
    • Developer Tools

      Problem Statement/Rationale

      What is going wrong? What action would you like the Engineering team to take?

      When using the typical sleep implementation depending on setTimeout and the promise constructor, Compass crashes leaving a white screen without any reaction to the user.

      Please be sure to attach relevant logs with any sensitive data redacted.
      How to retrieve logs for: Compass; Shell

      Steps to Reproduce

      How could an engineer replicate the issue you’re reporting?

      Go to the integrated shell and run the following code snippet:

      const sleep = (delay) => new Promise((resolve) => setTimeout(resolve, delay))
      sleep(1)
      

      Expected Results

      What do you expect to happen?
      setTimeout is a function that we are removing from the global scope (calling it in the root scope says the function does not exist). We should expect a similar error when defining the function, or in the worst case scenario, when the actual function is called.

      Actual Results

      What do you observe is happening?
      Compass just crashes and the only way to recover is either Ctrl-R to restart the whole process or closing and opening Compass.

      Additional Notes

      Any additional information that may be useful to include.

      Attached a recording of the issue.

            Assignee:
            Unassigned Unassigned
            Reporter:
            kevin.mas@mongodb.com Kevin Mas Ruiz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: