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

Clear-cache: include system-cache

Open Dominic-Marcelino opened this issue 11 months ago • 3 comments

The pull, diff and push commands each clear the cache at the beginning. https://github.com/tractr/directus-sync/blob/e647a2da35e8c6ca075d79eb60c8634f0e2fdf95/packages/cli/src/lib/services/migration-client.ts#L50-L54

However this does not clear the system-cache. Due to this it might fetch incorrect data related to the schema. In my case for example, I ran into an issue as it fetched old FK-Constraint names.

To prevent such issues, I suggest clearing the system-cache too. However, this option isn't available in the SDK yet, but should be coming soon: https://github.com/directus/directus/issues/24397

Dominic-Marcelino avatar Jan 13 '25 17:01 Dominic-Marcelino

Thanks @Dominic-Marcelino for the highlight. I will implement this once your PR is merged to Directus.

EdouardDem avatar Jan 16 '25 18:01 EdouardDem

Thanks @Dominic-Marcelino for the highlight. I will implement this once your PR is merged to Directus.

It's merged and released 👍

Dominic-Marcelino avatar Jan 20 '25 12:01 Dominic-Marcelino

@EdouardDem This could maybe also resolve https://github.com/tractr/directus-sync/issues/127

cheldt avatar Feb 10 '25 15:02 cheldt

@EdouardDem: Hi, I saw the comment "It's merged and released 👍" – could you please confirm in which release this fix is actually included? I couldn't find a reference to issue #135 in the changelog or release notes. Thanks for clarifying!

wagnerSquid avatar Jul 17 '25 10:07 wagnerSquid

@EdouardDem: Hi, I saw the comment "It's merged and released 👍" – could you please confirm in which release this fix is actually included? I couldn't find a reference to issue #135 in the changelog or release notes. Thanks for clarifying!

@wagnerSquid For reference: My comment It's merged and released 👍 referred to my PR for the directus SDK to support the parameter, not the implementation in directus-sync.

Dominic-Marcelino avatar Jul 17 '25 11:07 Dominic-Marcelino

Hi. It has been added in the new version: https://github.com/tractr/directus-sync/releases/tag/directus-sync%403.3.0

EdouardDem avatar Aug 14 '25 15:08 EdouardDem