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

Avoid mutating the static context, and isolate the static context objects #997

Merged
merged 3 commits into from
Dec 8, 2023

Conversation

ardatan
Copy link
Owner

@ardatan ardatan commented Dec 7, 2023

No description provided.

Copy link
Contributor

github-actions bot commented Dec 7, 2023

🚀 Snapshot Release (alpha)

The latest changes of this PR are available as alpha on npm (based on the declared changesets):

Package Version Info
@whatwg-node/server 0.9.19-alpha-20231208103622-91118e9d1b010469802a886923cec03411d07836 npm ↗︎ unpkg ↗︎

Copy link
Contributor

github-actions bot commented Dec 7, 2023

✅ Benchmark Results

     ✓ no-errors
     ✓ expected-result

     checks.........................: 100.00% ✓ 294282      ✗ 0     
     data_received..................: 29 MB   966 kB/s
     data_sent......................: 12 MB   392 kB/s
     http_req_blocked...............: avg=1.31µs   min=801ns    med=1.14µs   max=178.18µs p(90)=1.8µs    p(95)=1.99µs  
     http_req_connecting............: avg=0ns      min=0s       med=0s       max=114.53µs p(90)=0s       p(95)=0s      
     http_req_duration..............: avg=143.65µs min=97.02µs  med=138.04µs max=7.97ms   p(90)=160.29µs p(95)=167.15µs
       { expected_response:true }...: avg=143.65µs min=97.02µs  med=138.04µs max=7.97ms   p(90)=160.29µs p(95)=167.15µs
     http_req_failed................: 0.00%   ✓ 0           ✗ 147141
     http_req_receiving.............: avg=24.35µs  min=11.8µs   med=23.29µs  max=417.4µs  p(90)=30.23µs  p(95)=32.27µs 
     http_req_sending...............: avg=6.07µs   min=3.9µs    med=5.3µs    max=324.15µs p(90)=7.97µs   p(95)=8.5µs   
     http_req_tls_handshaking.......: avg=0s       min=0s       med=0s       max=0s       p(90)=0s       p(95)=0s      
     http_req_waiting...............: avg=113.22µs min=70.35µs  med=107.28µs max=7.92ms   p(90)=126.18µs p(95)=131.77µs
     http_reqs......................: 147141  4904.526925/s
     iteration_duration.............: avg=199.64µs min=141.18µs med=193.33µs max=8.08ms   p(90)=218.56µs p(95)=227.38µs
     iterations.....................: 147141  4904.526925/s
     vus............................: 1       min=1         max=1   
     vus_max........................: 1       min=1         max=1   

@ardatan ardatan merged commit 0c28ae9 into master Dec 8, 2023
6 checks passed
@theomessin
Copy link

theomessin commented Dec 10, 2023

@ardatan Getting the following error now due to this:

[                                                                                                                                                                                                                                                                                       
  TypeError: Cannot read properties of undefined (reading 'waitUntil')                                                                                                                                                                                                                  
      at handleRequestWithWaitUntil (/home/theodoremessinezis/Code/fountain/node_modules/.pnpm/@[email protected]/node_modules/@whatwg-node/server/esm/createServerAdapter.js:201:27)                                                                                           
      at Object.fetchFn [as fetch] (/home/theodoremessinezis/Code/fountain/node_modules/.pnpm/@[email protected]/node_modules/@whatwg-node/server/esm/createServerAdapter.js:216:24)                                                                                            
      at /home/theodoremessinezis/Code/fountain/node_modules/.pnpm/@[email protected]_@[email protected][email protected]/node_modules/@graphql-tools/executor-http/esm/index.js:102:32                                                                                  
      at /home/theodoremessinezis/Code/fountain/node_modules/.pnpm/[email protected]/node_modules/value-or-promise/src/ValueOrPromise.ts:80:36                                                                                                                                    
      at new ValueOrPromise (/home/theodoremessinezis/Code/fountain/node_modules/.pnpm/[email protected]/node_modules/value-or-promise/src/ValueOrPromise.ts:35:15)                                                                                                               
      at ValueOrPromise.then (/home/theodoremessinezis/Code/fountain/node_modules/.pnpm/[email protected]/node_modules/value-or-promise/src/ValueOrPromise.ts:80:11)                                                                                                              
      at __vite_ssr_import_1__.ValueOrPromise.then.responseDetailsForError.status (/home/theodoremessinezis/Code/fountain/node_modules/.pnpm/@[email protected]_@[email protected][email protected]/node_modules/@graphql-tools/executor-http/esm/index.js:89:26)        
      at new ValueOrPromise (/home/theodoremessinezis/Code/fountain/node_modules/.pnpm/[email protected]/node_modules/value-or-promise/src/ValueOrPromise.ts:35:15)                                                                                                               
      at executor (/home/theodoremessinezis/Code/fountain/node_modules/.pnpm/@[email protected]_@[email protected][email protected]/node_modules/@graphql-tools/executor-http/esm/index.js:59:16)                                                                        
      at /home/theodoremessinezis/Code/fountain/packages/api/src/user/tests/user.test.ts:26:24 {                                                                                                                                                                                        
    path: undefined,                                                                                                                                                                                                                                                                    
    locations: undefined,                                                                                                                                                                                                                                                               
    extensions: { requestBody: [Object], responseDetails: {} }                                                                                                                                                                                                                          
  }                                                                                                                                                                                                                                                                                     
]    

@ardatan
Copy link
Owner Author

ardatan commented Dec 10, 2023

Could you help me to reproduce it?

@theomessin
Copy link

Sure. Check out this reproduction repo:
https://github.com/theomessin/whatwg-node-issue

Just run pnpm i and pnpm test

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