thinger-io / thinger-server

Thinger.io Server Repository
MIT License
3 stars 0 forks source link

Sync locks not erasing when sync is deleted #35

Closed bautisflow closed 1 year ago

bautisflow commented 1 year ago

Describe the bug When a sync with locks is erases, and the a new sync is created with the same id as the one deleted, locks are still available.

To Reproduce Steps to reproduce the behavior:

  1. Create a sync with the id 'test_sync'
  2. Provision locks to the sync 'test_sync'
    curl -XPOST -H "Content-Type: application/json;charset=UTF-8" -H 'Authorization: Bearer <token>' 'https://perf.aws.thinger.io/v1/users/bautisflow/syncs/test_sync/locks'  -d '{"lock":"caracola1","slots":1,"timeout":0}' | jq
  3. Delete sync 'test_sync'
  4. Create as new sync with the same id: 'test_sync'
  5. Check provisioned lock in step 2 is available

Expected behavior Locks should be deleted from database

Additional context If the locks are maintained other services (database scraper) would return confusing information.