Skip to content

Conversation

@danthegoodman
Copy link
Contributor

Using the package in a node script is preventing the process from exiting because the reload interval timer has not been marked with unref. This PR resolves that issue.

For testing, I removed the --exit flag that had been previously been forcing mocha to exit immediately even if timers or servers were still open. This also required all servers and timers to in tests to be unrefed as well.

Checklist

  • only relevant code is changed (make a diff before you submit the PR)
  • run tests npm run test
  • tests are included
  • commit message and code follows the Developer's Certification of Origin

resolve(true)
setTimeout(() => reject(new Error('timeout')), 1500)
})
setTimeout(() => reject(new Error('timeout')), 1500).unref()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved this line so that it behaves as a proper timeout check against the backend.read call.

@danthegoodman
Copy link
Contributor Author

I didn't update the i18nextHttpBackend.js and ….min.js files because there were more changes in the files than just my targeted changes. I believe this is because the package-lock.json isn't in the repo, which means the babel/browserify packages have probably drifted slightly from the last run.

@adrai adrai merged commit f44ad1d into i18next:master May 17, 2024
@adrai
Copy link
Member

adrai commented May 17, 2024

thank you, it's included in v2.5.2

@danthegoodman
Copy link
Contributor Author

wow! So quick! Thank you 🎉

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

Successfully merging this pull request may close these issues.

2 participants