You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@davidism The proposal started as a question from me at first. But after a 2nd thought. I guess we can just keep the property RequestContext.g.
If we follow the idea to access attributes only where it's stored. The .app should not kept on RequestContext neither. Obviously, we can't remove .app from RequestContext cause it's also used in other methods on RequestContext, like .push(). This makes me doubt my former proposal. And keeping .g makes RequestContext a handy place to access all the globals (app, g, request, session). I tried to start a discussion with you maintainers in the original issue but haven't got any reply yet, only find a PR with this change got merged today.
g is not bound to the request context, it doesn't make sense as a property there. Additionally, the property always points at the top of the app context stack, not the context that was associated with the specific request context. I'm fine with the change, otherwise I wouldn't have made it.
Whether keeping g on RequestContext or not is totally okay for me. I couldn't make the decision before which is the reason I replied in the original issue.
the property always points at the top of the app context stack, not the context that was associated with the specific request context.
Thanks for pointing it out. I didn't consider the problem from this aspect.
This file contains hidden or 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
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
None yet
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It was moved to
AppContext.ga long time ago.closes #3898