-
Notifications
You must be signed in to change notification settings - Fork 298
Assistance with adding data separation (in a multi-user env, users cannot see each others chats) #52
Description
This issue is for a: (mark with an x)
- [ ] bug report -> please search issues before submitting
- [ x ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)
Minimal steps to reproduce
- Start the application & have 2 users open it in a browser.
- User 1 can then see User 2's chats and vice versa.
Expected/desired behavior
User 1 should not be able to see User 2's chats & vice versa.
Mention any other details that might be useful
I've deployed this for a large company (enterprise) as a quick method of demoing Azure OpenAI across business and allowing users to get hands on with it. However, almost immediately, complaints started to come in and haven't stopped (regarding seeing each others conversations).
I'm not familiar with Blazor, but to counter this issue, I've added "easy-auth" and code to retrieve the users AAD Id, which is then stored in the session (and against messages) item in cosmos DB & is retrieved when the page loads via "NavMenu.razor", then gets passed to "ChatPane.razor" & "ChatService.cs" etc... as needed.
When sessions or ChatMessages are loaded, the UserId has also been added into the queries to CosmosDb, to ensure that only the users session data is returned.
However, seemingly randomly, the users view switches to see another persons chats (instead of their own).
I can repro this now, by starting a debug session in VS, then opening two browser sessions (logged in as different AAD users).
Post initial page load, both users see their own views, but randomly, Tab1 will have the same conversation displayed as Tab 2, refreshing the page (Tab1), then shows the correct data for Tab1 again (Tab2, remains unchanged).
Rince and repeat...
Code Example: Enterprise-Dev
Can anyone give me a nudge in the right direction please?