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

fix(node): Resolve ace_ibma.Checker is not a constructor error #1845

Merged
merged 8 commits into from
Feb 16, 2024

Conversation

tombrunet
Copy link
Member

@tombrunet tombrunet commented Feb 16, 2024

  • Try to resolve the ace_ibma.Checker is not a constructor error

This PR is related to the following issue(s):

Additional information can be found here:

Currently, the generated ace-node.js file is updated multiple times when running in multiple threads, causing the ace_ibma.Checker is not a constructor error while reading it when the file is being overwritten.

This commit does the following things:

  1. Read the generated ace-node.js file if it exists and create the accessibility checker without overwriting the file.
  2. Throw error if there was a problem in writing the ace-node.js file instead of attempting to create the constructor from the non-existing file.

Due to the above change, we must update the generated file name.
The current file is stored as <cache-folder-name>/ace-node.js. If the cache folder is not cleared, this would cause issues when either rule archive or package version is changed, as we are no longer overwriting the file.

Suffixing rule and package version to the file name (e.g. ace-node-3.0.0-3.1.67.js) prevents this from happening.

Testing reference:

To test, run multiple accessibility tests using jest parallelly, ace_ibma.Checker is not a constructor error should not occur.
To verify that the generated file is not being overwritten, run fswatch -uvx <cache-folder-path>

I have conducted the following for this PR:

  • I validated this code in Chrome and FF
  • I validated this fix in my local env
  • I provided details for testing
  • This PR has been reviewed and is ready for test
  • I understand that the title of this PR will be used for the next release notes.

Rahul-Sivananda and others added 4 commits February 6, 2024 12:26
Currently, the generated `ace-node.js` file is updated multiple times in
threads. This commit reads the `ace-node.js` file if it exists and
will create the accessibility checker without overwriting the file.

Another change is to throw error if there was a problem in writing the
`ace-node.js` file instead of attempting to create the constructor from
the non existing file.
The current generated file name is stored as <cache-folder>/ace-node.js
If the cache folder is not cleared, this would cause problems when
either rule archive or package version is changed as we are no longer
overwriting the file

Suffixing rule and package version to the file name prevent this from
happening.
@tombrunet tombrunet changed the title Ctor_error Debugging build - do not merge Feb 16, 2024
@tombrunet tombrunet changed the title Debugging build - do not merge fix(node): Resolve ace_ibma.Checker is not a constructor error Feb 16, 2024
@tombrunet tombrunet marked this pull request as ready for review February 16, 2024 20:05
@ErickRenteria ErickRenteria added this pull request to the merge queue Feb 16, 2024
Merged via the queue into master with commit 290824b Feb 16, 2024
14 of 15 checks passed
@tombrunet tombrunet deleted the ctor_error branch April 11, 2024 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants