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

Collection not delete when sync to another instance

Open mason5991 opened this issue 1 year ago • 2 comments

Describe the bug There are same collection(testPost ) in two instances A and B. I have deleted the collection in instance A and try to run directus sync to instance B, but the collection did not get deleted.

diff: {
      "collections": [
        {
          "collection": "testPost",
          "diff": [
            {
              "kind": "D",
              "lhs": {
                "collection": "testPost",
                "meta": {
                  "accountability": "all",
                  "archive_app_filter": true,
                  "archive_field": null,
                  "archive_value": null,
                  "collapse": "open",
                  "collection": "testPost",
                  "color": "#FFC23B",
                  "display_template": null,
                  "group": "mysharepost",
                  "hidden": false,
                  "icon": null,
                  "item_duplication_fields": null,
                  "note": null,
                  "preview_url": null,
                  "singleton": false,
                  "sort": 4,
                  "sort_field": null,
                  "translations": null,
                  "unarchive_value": null,
                  "versioning": false
                },
                "schema": {
                  "name": "testPost"
                }
              }
            }
          ]
        }
      ],
      "fields": [],
      "relations": []
    } 

To Reproduce Steps to reproduce the behavior:

  1. Instance A delete a collection
  2. Run directus-sync pull and push to Instance B
  3. Diff log showing there is a collection will be deleted
  4. Collection still exist in Instance B. Diff log keeps showing the same.

Expected behavior Collection should be deleted

Versions (please complete the following information):

  • Directus-Sync version: 3.1.5
  • Directus version: 11.1.1
  • Directus environment Docker

mason5991 avatar Dec 10 '24 15:12 mason5991

Hi @mason5991, I will try to reproduce the bug on my side. I have few question :

  • Which database are you using ?
  • Do you have any error during the push operation ?
  • Did you try to use the --force flag during the push ?

EdouardDem avatar Dec 12 '24 19:12 EdouardDem

Hi @mason5991, I will try to reproduce the bug on my side. I have few question :

  • Which database are you using ?
  • Do you have any error during the push operation ?
  • Did you try to use the --force flag during the push ?

I am using pg v16. No error shown during push operation. Didn't try --force as I am afraid any harm to existing setup.

mason5991 avatar Dec 17 '24 09:12 mason5991