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

Latest version 5.0.2 is not tagged. #459

Closed
danielbarr3ra opened this issue Aug 1, 2022 · 4 comments
Closed

Latest version 5.0.2 is not tagged. #459

danielbarr3ra opened this issue Aug 1, 2022 · 4 comments

Comments

@danielbarr3ra
Copy link

danielbarr3ra commented Aug 1, 2022

npmjs lists 5.0.2 as latest version but it is not tagged on this repo yet. Is this intended?
https://www.npmjs.com/package/fibers

@laverdet
Copy link
Owner

laverdet commented Aug 1, 2022

We can diff it from npm, looks like some logging changes.. maybe some internal meteor diagnostics that snuck into npm? @renanccastro would be able to comment further.

diff -pubr a/fibers/fibers.js b/fibers/fibers.js
--- a/fibers/fibers.js	2022-08-01 11:47:05.000000000 -0500
+++ b/fibers/fibers.js	2022-08-01 11:46:36.000000000 -0500
@@ -85,21 +85,46 @@ function setupAsyncHacks(Fiber) {
 			}
 		}
 
-		function wrapFunction(fn) {
-			return function() {
+		function logUsingFibers(fibersMethod) {
+			const logUseFibersLevel = +(process.env.ENABLE_LOG_USE_FIBERS || 0);
+
+			if (!logUseFibersLevel) return;
+
+			if (logUseFibersLevel === 1) {
+				console.warn(`[FIBERS_LOG] Using ${fibersMethod}.`);
+				return;
+			}
+
+			const { LOG_USE_FIBERS_INCLUDE_IN_PATH } = process.env;
+			const stackFromError = new Error(`[FIBERS_LOG] Using ${fibersMethod}.`).stack;
+
+			if (
+				!LOG_USE_FIBERS_INCLUDE_IN_PATH ||
+				stackFromError.includes(LOG_USE_FIBERS_INCLUDE_IN_PATH)
+			) {
+				console.warn(stackFromError);
+			}
+		}
+
+		function wrapFunction(fn, fibersMethod) {
+			return function () {
+				logUsingFibers(fibersMethod);
 				var stack = getAndClearStack();
 				try {
 					return fn.apply(this, arguments);
 				} finally {
 					restoreStack(stack);
 				}
-			}
+			};
 		}
 
 		// Monkey patch methods which may long jump
-		Fiber.yield = wrapFunction(Fiber.yield);
-		Fiber.prototype.run = wrapFunction(Fiber.prototype.run);
-		Fiber.prototype.throwInto = wrapFunction(Fiber.prototype.throwInto);
+		Fiber.yield = wrapFunction(Fiber.yield, "Fiber.yield");
+		Fiber.prototype.run = wrapFunction(Fiber.prototype.run, "Fiber.run");
+		Fiber.prototype.throwInto = wrapFunction(
+			Fiber.prototype.throwInto,
+			"Fiber.throwInto"
+		);
 
 	} catch (err) {
 		return;
diff -pubr a/fibers/package.json b/fibers/package.json
--- a/fibers/package.json	2022-08-01 11:47:05.000000000 -0500
+++ b/fibers/package.json	2022-08-01 11:46:36.000000000 -0500
@@ -1,6 +1,6 @@
 {
 	"name": "fibers",
-	"version": "5.0.1",
+	"version": "5.0.2",
 	"description": "Cooperative multi-tasking for Javascript",
 	"keywords": [
 		"fiber",

@renanccastro-provi
Copy link

renanccastro-provi commented Aug 2, 2022

Hi, @laverdet I'm not member of Meteor core anymore, sorry. I've pinged them and Denilson or Fred will chime in pretty soon.

@denihs
Copy link
Collaborator

denihs commented Aug 2, 2022

Hi @laverdet, we created a tag in our fork, but Renan informed us we should use this one. I've made this PR to update this repository, so we create the tag 5.0.2.

Could you give me admin access as well?

@denihs
Copy link
Collaborator

denihs commented Aug 9, 2022

As I created the new v5.0.2 tag, I'm closing this issue now https://github.com/laverdet/node-fibers/releases/tag/v5.0.2.

@denihs denihs closed this as completed Aug 9, 2022
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

No branches or pull requests

4 participants