directus-sync icon indicating copy to clipboard operation
directus-sync copied to clipboard

User assigned policy is removed during push

Open TomSteer opened this issue 10 months ago • 5 comments

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

TomSteer avatar Feb 12 '25 11:02 TomSteer

@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 avatar Feb 18 '25 23:02 EdouardDem

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 avatar Feb 19 '25 11:02 TomSteer

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 avatar Mar 03 '25 13:03 TomSteer

@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.

TomSteer avatar Mar 05 '25 08:03 TomSteer

@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.

EdouardDem avatar Mar 19 '25 03:03 EdouardDem