Skip to content
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

When deleting a collections, records are deleted but tombstone aren't #136

Merged
merged 3 commits into from Jul 31, 2015

Conversation

Natim
Copy link
Member

@Natim Natim commented Jul 17, 2015

https://github.com/mozilla-services/kinto/blob/master/kinto/views/collections.py#L31-L35

echo '{"data": {"title": "toto"}}' | http POST http://localhost:8888/v1/buckets/default/collections/tasks/records --auth user:pass

http DELETE http://localhost:8888/v1/buckets/default/collections/tasks/records/667c36ba-5a27-45bc-b9a4-94f3d4d46bf4 --auth user:pass

http GET http://localhost:8888/v1/buckets/default/collections/tasks/records?_since=1436786412344 --auth user:pass

http DELETE http://localhost:8888/v1/buckets/default/collections/tasks --auth user:pass

echo '{"data": {}}' | http PUT http://localhost:8888/v1/buckets/default/collections/tasks --auth user:pass

http GET http://localhost:8888/v1/buckets/default/collections/tasks/records?_since=1436786412344 --auth user:pass
HTTP/1.1 200 OK
Access-Control-Expose-Headers: Backoff, Retry-After, Alert, Next-Page, Total-Records, Last-Modified, ETag
Content-Length: 101
Content-Type: application/json; charset=UTF-8
Date: Mon, 13 Jul 2015 11:20:52 GMT
Etag: "1436786412345"
Last-Modified: Mon, 13 Jul 2015 11:20:12 GMT
Server: waitress
Total-Records: 0

{
    "data": [
        {
            "deleted": true, 
            "id": "667c36ba-5a27-45bc-b9a4-94f3d4d46bf4", 
            "last_modified": 1436786412345
        }
    ]
}

@Natim
Copy link
Member Author

Natim commented Jul 13, 2015

Same problem if you:

  • DELETE the bucket
  • Recreate the bucket
  • Recreate the collection
  • check for tombstones (they are presents)

@Natim
Copy link
Member Author

Natim commented Jul 13, 2015

Same for collections.

$ http GET http://localhost:8888/v1/buckets/default/collections/tasks/records?_since=1436786412344 --auth user:pass
$ http DELETE http://localhost:8888/v1/buckets/default --auth user:pass
$ echo '{"data": {}}' | http PUT http://localhost:8888/v1/buckets/default --auth user:pass
$ http GET http://localhost:8888/v1/buckets/default/collections?_since=1234 --auth user:pass

@Natim Natim added the bug label Jul 13, 2015
@Natim Natim changed the title On deleting a collections, records are deleted but tombstone aren't When deleting a collections, records are deleted but tombstone aren't Jul 13, 2015
@Natim Natim self-assigned this Jul 17, 2015
@Natim
Copy link
Member Author

Natim commented Jul 30, 2015

Needs mozilla-services/cliquet#400 to be merged first.

@Natim
Copy link
Member Author

Natim commented Jul 30, 2015

r? @leplatrem @ametaireau

@leplatrem
Copy link
Contributor

LGTM !

Just wondering : why sometimes with_deleted and sometimes not ?

@@ -118,16 +118,24 @@ def delete(self):
storage = self.collection.storage
parent_id = '/buckets/%s' % self.record_id
storage.delete_all(collection_id='group', parent_id=parent_id)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing a with_deleted=False

@Natim Natim force-pushed the 136-when-deleting-a-collection-also-delete-tombstones branch from 0a15fbe to 02be605 Compare July 30, 2015 14:14
Natim added a commit that referenced this pull request Jul 31, 2015
…o-delete-tombstones

When deleting a collections, records are deleted but tombstone aren't
@Natim Natim merged commit 77fe1aa into master Jul 31, 2015
@Natim Natim deleted the 136-when-deleting-a-collection-also-delete-tombstones branch July 31, 2015 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants