Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fireproof

Package Overview
Dependencies
Maintainers
1
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fireproof - npm Package Compare versions

Comparing version 0.1.5 to 0.1.6

46

index.js

@@ -170,2 +170,13 @@

/* FIXME(goldibex): Find out the reason for this demonry.
* For reasons completely incomprehensible to me, some type of race condition
* is possible if multiple Fireproof references attempt authentication at the
* same time, the result of which is one or more of the promises will never
* resolve.
* Accordingly, it is necessary that we wrap authentication actions in a
* global lock. This is accomplished using setInterval. No, I don't like it
* any more than you do.
*/
var authing = false;
/**

@@ -184,22 +195,29 @@ * Delegates Firebase#auth.

nextTick(function() {
var authIntervalId = setInterval(function() {
self._ref.auth(authToken, function(err, info) {
if (!authing) {
if (err !== null) {
promise(false, [err]);
} else {
promise(true, [info]);
}
authing = true;
self._ref.auth(authToken, function(err, info) {
if (typeof onComplete === 'function') {
nextTick(function() {
onComplete(err, info);
});
}
authing = false;
clearInterval(authIntervalId);
if (err !== null) {
promise(false, [err]);
} else {
promise(true, [info]);
}
}, onCancel);
if (typeof onComplete === 'function') {
nextTick(function() {
onComplete(err, info);
});
}
});
}, onCancel);
}
}, 1);
return promise;

@@ -206,0 +224,0 @@

{
"name": "fireproof",
"version": "0.1.5",
"version": "0.1.6",
"description": "Promises for Firebase objects.",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc