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

A previously deleted quad cannot be re-added when using GaeDatastore #578

Closed
gkontos opened this issue Apr 28, 2017 · 1 comment
Closed

Comments

@gkontos
Copy link
Contributor

gkontos commented Apr 28, 2017

Description

When using datastore, a deleted quad cannot be re-added. This happens if the code is deleting and adding quads in order to update. This error will be encountered if ignore_duplicate is set to true when using Datastore.

Steps to reproduce the issue:
q := quad.Make(quad.IRI("ID"), quad.IRI("schema:name"),quad.String("Original Name"),nil)
qs.AddQuad(q)

Delete the quad :
qs.RemoveQuad(q)

Add the quad again :
q := quad.Make(quad.IRI("ID"), quad.IRI("schema:name"),quad.String("Original Name"),nil)
qs.AddQuad(q)

Received results:
The quad will not be retrieved by an iterator.

Expected results:
The quad should be retrieved by an iterator.

Output of cayley version or commit hash:
v0.6.1

Environment details:
Gaedatastore

** Potentially misleading user research **
Line 186 of graph/gaedatastore/quadstore.go starts a nested if statement which will bypass setting keep = true. With keep = false, the node doesn't get an additional ID for quad.Added in the updateQuads() function. Line 250 of graph/gaedatastore/iterator.go will then skip the quad in the Next() function.

@barakmich
Copy link
Member

Fantastic bug report. User research seems solid 👍

gkontos added a commit to gkontos/cayley that referenced this issue May 6, 2017
@dennwc dennwc closed this as completed in decd378 May 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants