-
-
Notifications
You must be signed in to change notification settings - Fork 113
Handle doc lookup where id not found, and remove problematic hash-to-query addon #592
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
Handle doc lookup where id not found, and remove problematic hash-to-query addon #592
Conversation
The |
let encodedRevId = encodeURIComponent(revId); | ||
url = `json-docs/${projectName}/${version}/${pluralize(modelNameToUse)}/${encodedRevId}`; | ||
} else { | ||
throw new Error('Documentation item not found'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this just trading a "cannot access blah
of undefined" error with a "Documentation item not found" error?
My experience with the issue of thrown errors causing potential memory leaks is that any kind of error will cause it 🤔 Would we be able to console.log()
this message and then just return null or something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we catch the error in the calling route model function, and then handle it. My assumption was that it was the uncaught error that was causing it, which was happening because we were letting the error happen deep in the nodejs fetch code as opposed to here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that sounds legit to me 🎉 😂 I wasn't actually sure if you handled the error anywhere or if it ended up being "unhandled" from Ember's perspective
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me 👍
I plan to do some extra memory heap analysis before deploying this change using some tips from tom: ember-fastboot/fastboot#100 (comment) |
Addresses #589
This defect does a couple of things to potentially help out some of the high heroku memory usage and load we've been seeing.
undefined.json
we've been seeing over and over again in the logs.hash-to-query
internal addon, which adds a script to index.html that performs a reload of the url to fetch a method or property defined after the hash in the url of a legacy link. This approach has shown to be unreliable and often results in the errors above, as well as multiple requests made to the server (and decreased user experience). For the time being, we'll only support legacy urls at the class/namespace/package level and not at the method/property/event level. The user will still be taken to the right page, but they'll have to find the function onscreen.