Skip to content

User assigned policy is removed during push #156

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

Open
TomSteer opened this issue Feb 12, 2025 · 5 comments
Open

User assigned policy is removed during push #156

TomSteer opened this issue Feb 12, 2025 · 5 comments
Labels
bug Something isn't working

Comments

@TomSteer
Copy link

Describe the bug
When a policy is assigned at the user level, running a push will remove the assignment.
This was fixed in version 3.2.1 but seems to be happening again in version 3.2.3

To Reproduce
Steps to reproduce the behavior:

Assign a policy to a user in Directus
Run directus-sync push
Open user account in Directus
See policy is no longer assigned
Expected behavior
As users aren't included as part of the sync I would've expected it not to remove the policy assignment.

Versions:

Directus-Sync version: 3.2.3
Directus version: 11.3.5
Database: MSSQL
Directus environment Docker/Self-hosted

@EdouardDem
Copy link
Member

@TomSteer I couldn't reproduce the issue. I will add more testing.
If you revert to previous version (npx [email protected] push), does it work ?

@EdouardDem EdouardDem added the bug Something isn't working label Feb 18, 2025
@TomSteer
Copy link
Author

Hi @EdouardDem ,

Downgrading to 3.2.2 still results in the same issue. However, downgrading to 3.2.1 does fix the issue. I'm not sure what other effects this might have, as I recall you mentioned that 3.2.2 fixes a regression from the 3.2.1 fix.

If you need any more information then just let me know. Thanks again for looking into the issue!

@TomSteer
Copy link
Author

TomSteer commented Mar 3, 2025

Hi @EdouardDem, Any luck on narrowing this one down? Is there an edge we should be aware of if we downgrade to 3.2.1?

@TomSteer
Copy link
Author

TomSteer commented Mar 5, 2025

@EdouardDem I think I've narrowed the issue down. It only seems to happen for policies that aren't assigned to a role.

To Reproduce
Steps to reproduce the behavior:

Create a policy in Directus that isn't assigned to a user or role.
Run directus-sync pull
Assign the policy to a user in Directus
Run directus-sync push
Open user account in Directus
See policy is no longer assigned
Expected behavior
As users aren't included as part of the sync I would've expected it not to remove the policy assignment.

@EdouardDem
Copy link
Member

@TomSteer Thank you for pointing this solution.
I'm a bit busy these days. You could use version 3.2.1 until I fix the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants