Comments (13)
from mit-license.
Looks like it's crashing quite often:
2020-12-14T16:08:26.360267+00:00 app[web.1]: /app/routes/get.js:63
2020-12-14T16:08:26.360276+00:00 app[web.1]: if (user.copyright) {
2020-12-14T16:08:26.360278+00:00 app[web.1]: ^
2020-12-14T16:08:26.360278+00:00 app[web.1]:
2020-12-14T16:08:26.360279+00:00 app[web.1]: TypeError: Cannot read property 'copyright' of undefined
2020-12-14T16:08:26.360280+00:00 app[web.1]: at module.exports (/app/routes/get.js:63:12)
2020-12-14T16:08:26.360281+00:00 app[web.1]: at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
2020-12-14T16:08:26.360282+00:00 app[web.1]: at next (/app/node_modules/express/lib/router/route.js:137:13)
2020-12-14T16:08:26.360283+00:00 app[web.1]: at Route.dispatch (/app/node_modules/express/lib/router/route.js:112:3)
2020-12-14T16:08:26.360283+00:00 app[web.1]: at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
2020-12-14T16:08:26.360284+00:00 app[web.1]: at /app/node_modules/express/lib/router/index.js:281:22
2020-12-14T16:08:26.360284+00:00 app[web.1]: at param (/app/node_modules/express/lib/router/index.js:354:14)
2020-12-14T16:08:26.360284+00:00 app[web.1]: at param (/app/node_modules/express/lib/router/index.js:365:14)
2020-12-14T16:08:26.360285+00:00 app[web.1]: at Function.process_params (/app/node_modules/express/lib/router/index.js:410:3)
2020-12-14T16:08:26.360285+00:00 app[web.1]: at next (/app/node_modules/express/lib/router/index.js:275:10)
from mit-license.
@Richienb didn't you do a refactor recently?
from mit-license.
@remy I did one three months ago.
from mit-license.
This issue only happens periodically - I am unable to reproduce it consistently.
from mit-license.
I (think I) found the problem: It's all to do with a Javascript quirk.
Here we assign response.locals.user
by extending itself with the result of a promise.
mit-license/middleware/load-user.js
Lines 17 to 20 in aa280a6
Notice that we await it within the assignment. What do you think response.locals.user
looks like while the promise is still pending?
It actually temporarily sets it to what is essentially undefined
.
To fix it, we just need to await the data before the assignment:
mit-license/middleware/load-user.js
Lines 17 to 22 in 6d916f4
I've just set up a quick uptime page so we can track if this change did anything.
from mit-license.
from mit-license.
cname lookup?
from mit-license.
Sorry, we're crossing messages.
That await won't return the user object until the promise has settled (so the refactor here shouldn't make any difference).
The user object is definitely undefined. If it were set to a promise it would pass the test for user.cooyright
(because we can do prop lookups on a promise - regardless of whether the promise has settled or not).
from mit-license.
It seems to be working again now.
from mit-license.
from mit-license.
It's happened again today. 3/2/21 at 3:38 GMT
from mit-license.
The last recorded downtime is on February 11, 2021. I believe this means the issue is now resolved.
from mit-license.
Related Issues (20)
- Deployment failed? HOT 10
- My mit license link is not working HOT 1
- A tool to hack camera from termux HOT 1
- Some links are not working HOT 5
- Link not Working - Application Error HOT 11
- How to test? HOT 4
- Modifying the licence HOT 4
- Can you add me to the system? HOT 3
- Run HOT 1
- Fork HOT 1
- Deployment doesn't seem to be working for a while now HOT 13
- POST API doesn't work HOT 1
- GitHub license detection HOT 5
- Theme popularity
- Stewiecoin LICENSE
- MIT No Attribution (MIT-0) HOT 1
- I don't know what i did wrong HOT 2
- Says ive used my email already but I havent HOT 1
- CI workflows emit deprecation warnings
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mit-license.