-
Notifications
You must be signed in to change notification settings - Fork 0
Fix board isolation in multiuser implementation #26
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
base: lstein-master
Are you sure you want to change the base?
Conversation
Co-authored-by: lstein <111189+lstein@users.noreply.github.com>
Co-authored-by: lstein <111189+lstein@users.noreply.github.com>
…handling Co-authored-by: lstein <111189+lstein@users.noreply.github.com>
|
@copilot The Additionally |
Co-authored-by: lstein <111189+lstein@users.noreply.github.com>
... Fixed the Python test failures in commit 678d9c1: Test fixes:
All Python tests should now pass. For the TypeScript errors about |
lstein
left a comment
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.
Several issues are identified during testing:
- When two users, A and B, are logged in simultaneously and A initiates a generation, the generation preview shows up in both A and B's browsers and the generated image gets saved to both A and B's image boards. Non-administrative users should never see the images being generated by another user.
- The Uncategorized board appears to be shared across all users. At this time, each user should see his own Uncategorized board and should not see images in other users' Uncategorized board.
- When displaying the job queue, users should not be able to see Batch Field Values from generation processes launched by other users. The values should be blurred out if possible. Only the Administrator should be able to see values from generations launched by other users.
- When the job queue tab is open in multiple browsers and a generation is begun in one browser window, the queue does not update in the other window.
- New columns should be added to the job queue table showing the account name of the user who launched the job. If the account name is not set, then show the login name.
I've analyzed these issues. Several are outside the scope of this PR (board isolation), but I can identify the root causes: Issues #1, #3, #4, #5 (Job Queue & Real-time Events): These require changes to the session queue service and event broadcasting system - separate from board isolation. They need:
Issue #2 (Uncategorized Board Sharing): This is within scope but there's a critical bug - images aren't being assigned Should I:
The queue/event issues require broader changes across session queue, event services, and frontend queue components. |
Co-authored-by: lstein <111189+lstein@users.noreply.github.com>
Fixed issue #2 in commit 1916cbd. Changes made: Image Creation Now Assigns user_id:
Modified Files:
Now each user's uncategorized images will be properly isolated since they have the correct user_id assigned. |
|
@copilot This does not seem to have worked. When I am logged in as user B I continue to see user A's images in the Uncategorized board. |
…ation Co-authored-by: lstein <111189+lstein@users.noreply.github.com>
Found and fixed the issue in commit 57bb723. The problem was that the
While the previous commit added user_id to image creation and Fixed:
Now user B will only see their own uncategorized images, not user A's. |
|
@copilot Much improved. Two refinements requested:
|
…images Co-authored-by: lstein <111189+lstein@users.noreply.github.com>
Both refinements implemented in commit 6f8ff79: 1. Clear cached board images on logout/login:
2. Admin sees all uncategorized images:
|
lstein
left a comment
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.
Tested and works as advertised.
Summary
Fixes three board isolation issues in multiuser: admin users couldn't see all boards, uncategorized images were shared across users, and board state persisted when switching users.
Backend:
is_adminparameter to board queries - admins now see all boards, regular users see own + shareduser_idfiltering to uncategorized image queries - filters byimages.user_idwhenboard_id == "none"in bothlist_image_dtosandget_image_namesendpointsowner_usernametoBoardDTOfor admin visibilitylist_image_dtosandget_image_names)user_idto image creation pipeline - images now properly assigned to users when created via uploads or invocationsget_image_namesendpoint - added authentication and user_id filtering to close the uncategorized board isolation gapis_adminparameter to image queries allowing admins to see all uncategorized images from all users while regular users see only their ownFrontend:
selectedBoardId,autoAddBoardId,boardSearchText) on logout viaextraReducersImage,ImageList,ImageNameList,ImageCollection,ImageMetadata) to prevent cached images from previous user appearingTests:
is_adminparameter for board queriesBoardRecordobjects to include requireduser_idfieldComplete Uncategorized Board Isolation:
Three complementary changes were required for complete isolation:
user_idwhen images are created (via API uploads or invocations)user_idwhen querying uncategorized images in both endpoints:list_image_dtos- returns full image DTOs with metadataget_image_names- returns image name list for gallery display (was missing authentication and filtering)is_adminparameter that bypasses user_id filteringThe
get_image_namesendpoint was the missing piece - it lacked both authentication and user_id filtering, allowing all users to see each other's uncategorized images. Both endpoints now properly enforce user isolation for regular users while allowing admins full visibility.Example - Admin Board Query:
Example - Admin Uncategorized Image Access:
Note: Additional multiuser isolation issues related to real-time events, generation previews, and job queue filtering are outside the scope of this PR and will be addressed separately.
Related Issues / Discussions
See
docs/multiuser/board_isolation_issue.mdfor detailed specification.QA Instructions
Test board isolation for regular users:
Test admin board visibility:
Test uncategorized board isolation for regular users:
Test admin uncategorized board access:
Test state cleanup and cache clearing on user switch:
Merge Plan
N/A
Checklist
What's Newcopy (if doing a release after this PR)Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.