-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* bug: fix reload Before this fix the server was unusable after doing `/reload`, displaying this error: ``` TypeError: Cannot read property 'size' of undefined at app.use (webpack:///./src/server.ts?:22:86) at Layer.handle [as handle_request] (webpack:///./node_modules/express/lib/router/layer.js?:95:5) at trim_prefix (webpack:///./node_modules/express/lib/router/index.js?:317:13) at eval (webpack:///./node_modules/express/lib/router/index.js?:284:7) at Function.process_params (webpack:///./node_modules/express/lib/router/index.js?:335:12) at next (webpack:///./node_modules/express/lib/router/index.js?:275:10) at expressInit (webpack:///./node_modules/express/lib/middleware/init.js?:40:5) at Layer.handle [as handle_request] (webpack:///./node_modules/express/lib/router/layer.js?:95:5) at trim_prefix (webpack:///./node_modules/express/lib/router/index.js?:317:13) at eval (webpack:///./node_modules/express/lib/router/index.js?:284:7) ``` The key problem is that the `/reload` route calls `db.bundleFromEnvironment()` which is a promise, but it doesn't wait for it to resolve. I also had to change the bundle reference in all the resolver functions in `schema.ts` because otherwise after reload if continued serving the old data. This is because it kept in its scope a reference to the original bundle pointed at during load time. * use pure functions
- Loading branch information
Showing
3 changed files
with
20 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters