Handling multiple user contexts
See original GitHub issueHi,
I was wondering how to add a user context to something like
Async.each(users, (user, callback) => {
Sentry.configureScope((scope) => {
scope.setUser(user);
});
// Do something async for the user
// capture error for user in/after that async function
// Resulting user context will be the last user
}, callback);
I’ve tried creating a specific hub but that had the same issue
const userSpecificHub = new Sentry.Hub(Sentry.getCurrentHub().getClient());
userSpecificHub.run(() => {/* above example code here */})
Trying to do userSpecificHub.configureScope
to set the user resulted in the second hub/scope to have no user context.
I’m probably doing something wrong but I’m trying to add some context to some background processes (most of them get started by https://github.com/kelektiv/node-cron/)
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
React multiple contexts - Stack Overflow
createContext('light'); // Signed-in user context const UserContext = React.createContext({ name: 'Guest', }); class App extends React.
Read more >How do I handle multiple user contexts in an app?
Try using a modal for the search and find or create activities within the primary use case, which according to the brief description...
Read more >Context - React
Context is designed to share data that can be considered “global” for a tree of React components, such as the current authenticated user,...
Read more >How to combine context providers for cleaner React code
Context Providers are just functions therefore they can be composted, and used to create AppContextProvider lets just do that then. First, let's create...
Read more >Manage FAST Search user contexts - Microsoft Support
Display the Manage User Context page · Log on to the home page of your top-level site with site collection administrator permissions. ·...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Do you have access to the user throughout the whole life-span of that async function and you capture errors manually? Or do you want to rely on integrations?
If former, then it should be:
However, if you want to have a separate hub for a whole life-span and modify it in various places, then this will work:
Closing as this seems to be solved.