this is how I've solved possible ID saturation on most of my projects: don't just id++ if you want to be sure that such id is unique, use Int32Array or Uint32Array instead to let the ID cap and reset without issues, granting safety against MAX_SAFE_INTEGER