fix(multiuser): make preexisting workflows visible after migration#9049
fix(multiuser): make preexisting workflows visible after migration#9049
Conversation
PR #9018 assigned preexisting workflows user_id='system' with is_public=FALSE, causing them to disappear from all users' libraries. - Add migration 30: sets is_public=TRUE for all system-owned workflows so they appear under "Shared Workflows" - Skip user_id filtering for admins in workflow listing endpoints so they can see and manage all workflows including system-owned ones - Show the Shared toggle to admins on system-owned workflows in the workflow list UI - Update multiuser user guide to document private/shared workflows, private/shared/public image boards, and warn about preexisting workflows appearing in shared section - Add regression tests for system workflow visibility, admin CRUD access, and regular user access denial Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
JPPhoto
left a comment
There was a problem hiding this comment.
Looks good, works well. My only question is if the changes to the database should be made as a change to migration_28.py as this hasn't really been out in the wild and admins will still be able to fix visibility on workflows now even if migration 28 ran before.
It won't hurt to do that. I'll make the change now. |
|
Are you planning to remove |
I've altered the tests for migration_28. I wasn't going to remove migration_30 because I don't know how many people will have deployed in the interval. Is it more than N=1 do you think? |
I think it's maybe N=4, probably all devs, and I don't think it's worth having another migration in place since the admin user will be able to see and modify all workflows per the rest of the PR. |
|
@lstein The core issue now:
|
True. The fix is to keep the default Just working through an issue that occurs when going from multiuser mode back to single-user. |
|
Migration is now fixed to make existing workflows shared and owned by 'system'. New workflows created by users will be private by default. I also took the opportunity to suppress all the UI having to do with workflow sharing when running in single-user mode. The only thing that may be off in the UI is that workflows created and shared in multiuser mode still have the "shared" tag when viewed in single-user mode. To me this is a useful feature because it maintains some history about the workflow. Docs and tests have been updated to be consistent with the desired behavior. I think it is good to go, but please test both in single-user and multi-user mode:
When running in multiuser mode:
When running in single user mode:
|
JPPhoto
left a comment
There was a problem hiding this comment.
Good in my basic testing, switching from multi-user to single and back, etc. Would love more community testing of this.
Summary
user_id='system'withis_public=FALSE, causing them to disappear from all users' librariesis_public=TRUEfor all system-owned workflows so they appear under "Shared Workflows"user_idfilter in workflow listing endpoints, giving them visibility into all workflows including system-owned onescanEditOrDeleteinstead ofisOwner)Test plan
pytest tests/app/routers/test_workflows_multiuser.py— 21 tests passpytest tests/test_sqlite_migrator.py— 23 tests pass🤖 Generated with Claude Code