Skip to content

Commit

Permalink
fix: add missing timer cb provided args when restoring execution context
Browse files Browse the repository at this point in the history
chore: upgrade deps
  • Loading branch information
Inqnuam committed Jan 15, 2025
1 parent 5f275bb commit 3a2f32a
Show file tree
Hide file tree
Showing 4 changed files with 868 additions and 874 deletions.
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "serverless-aws-lambda",
"version": "5.0.0",
"version": "5.0.1",
"description": "AWS Application Load Balancer and API Gateway - Lambda dev tool for Serverless. Allows Express synthax in handlers. Supports packaging, local invoking and offline ALB, APG, S3, SNS, SQS, DynamoDB Stream server mocking.",
"author": "Inqnuam",
"license": "MIT",
Expand Down Expand Up @@ -63,23 +63,23 @@
}
},
"dependencies": {
"@aws-sdk/client-sqs": "^3.682.0",
"@smithy/eventstream-codec": "^3.1.7",
"@aws-sdk/client-sqs": "^3.726.1",
"@smithy/eventstream-codec": "^4.0.1",
"@types/serverless": "^3.12.22",
"ajv": "^8.17.1",
"ajv-formats": "^3.0.1",
"archiver": "^5.3.1",
"esbuild": "0.24.0",
"fast-xml-parser": "^4.5.0",
"esbuild": "0.24.2",
"fast-xml-parser": "^4.5.1",
"local-aws-sqs": "^1.0.2",
"serve-static": "^1.15.0"
"serve-static": "^1.16.2"
},
"devDependencies": {
"@types/archiver": "^5.3.2",
"@types/node": "^14.14.31",
"@types/serve-static": "^1.15.5",
"typescript": "^5.6.3",
"vitest": "^2.1.4"
"typescript": "^5.7.3",
"vitest": "^2.1.8"
},
"keywords": [
"aws",
Expand Down
4 changes: 3 additions & 1 deletion src/lib/runtime/runners/node/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ interface IEventQueueContext {
}

export class EventQueue extends Map {
private static readonly EMPTY_ARGS = [];
static IGNORE = ["PROMISE", "RANDOMBYTESREQUEST", "PerformanceObserver", "TIMERWRAP"];
onEmpty?: () => void;
requestId: string;
Expand Down Expand Up @@ -249,9 +250,10 @@ export class EventQueue extends Map {
const timmerTime = resource._repeat ? "setInterval" : "setTimeout";
const fnString = resource._onTimeout.toString();
const org = resource._onTimeout.bind(resource._onTimeout);
const cbArgs = resource._timerArgs ?? EventQueue.EMPTY_ARGS;
resource._onTimeout = () => {
try {
org();
org(...cbArgs);
} catch (error) {
const data = genResponsePayload(error);
const solution = genSolution(fnString);
Expand Down
6 changes: 3 additions & 3 deletions templates/simple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
"type": "module",
"devDependencies": {
"prettier": "3.2.5",
"serverless": "^3.38.0",
"serverless-aws-lambda": "^5.0.0",
"serverless": "^3.40.0",
"serverless-aws-lambda": "^5.0.1",
"serverless-aws-lambda-vitest": "^3.0.2",
"typescript": "^5.6.3"
"typescript": "^5.7.3"
},
"scripts": {
"sls": "sls",
Expand Down
Loading

0 comments on commit 3a2f32a

Please sign in to comment.