Prevent update on SELECT result
It is possible to submit a SELECT query, modify the result and update it. This easily allows to cause unexepected data loss.
How should this be prevented? Should this be done by the client or by the server (or both)?
DoD
- Reproduced
- Tests written caosdb-pyinttest!10 (merged)
This issue only covers the confirmation. See caosdb-server#155 for the fix
- Show closed items
Activity
-
Newest first Oldest first
-
Show all activity Show comments only Show history only
- Henrik tom Wörden added BugUnconfirmed label
added BugUnconfirmed label
- Florian Spreckelsen changed iteration to Sprint Jun 14, 2021 - Jun 25, 2021
changed iteration to Sprint Jun 14, 2021 - Jun 25, 2021
- Florian Spreckelsen added Statusnext label
added Statusnext label
- Florian Spreckelsen assigned to @florian and unassigned @henrik
- Florian Spreckelsen added Statustodo label and removed Statusnext label
added Statustodo label and removed Statusnext label
- Florian Spreckelsen added (B label
added (B label
- Florian Spreckelsen set weight to 2
set weight to 2
- Florian Spreckelsen added P2 label
added P2 label
- Florian Spreckelsen added Statusdoing label and removed Statustodo label
added Statusdoing label and removed Statustodo label
- Owner
This is not easily possible to do by mistake at least: The return of a SELECT query doesn't have parents, so
import caosdb as db prop1 = db.Property(name="TestProp1", datatype=db.TEXT).insert() prop2 = db.Property(name="TestProp2", datatype=db.TEXT).insert() rt = db.RecordType(name="TestType").insert() rec = db.Record(name="TestRec").add_parent(rt) rec.add_property(name=prop1.name, value="Bla") rec.add_property(name=prop2.name, value="BlaBla") rec.insert() selected = db.execute_query("SELECT {} FROM RECORD {}".format(prop1.name, rt.name))[0] selected.update()
will result in a
TransactionError
. However, with an additionalselected.add_parent(rt)
before theupdate
, the update will work andTestRec
will be overwritten (and thus, dropTestProp2
). - Florian Spreckelsen added BugConfirmed label and removed BugUnconfirmed label
added BugConfirmed label and removed BugUnconfirmed label
- Florian Spreckelsen changed the description
Compare with previous version changed the description
- Florian Spreckelsen changed milestone to %Story Telling
changed milestone to %Story Telling
- Owner
On Hold until discussed in story telling.
- Florian Spreckelsen added On Hold Statustodo labels and removed Statusdoing label
added On Hold Statustodo labels and removed Statusdoing label
- Florian Spreckelsen removed On Hold label
removed On Hold label
- Owner
In the future, the server will mark containers, that result from a select query (or similar) as "incomplete". Pylib will need a special treatment of incomplete containers that ensures they cannot (easily) be updated.
- Florian Spreckelsen removed milestone %Story Telling
removed milestone %Story Telling
- Florian Spreckelsen mentioned in issue caosdb-server#155
mentioned in issue caosdb-server#155
- Florian Spreckelsen marked the checklist item Reproduced as completed
marked the checklist item Reproduced as completed
- Florian Spreckelsen changed the description
Compare with previous version changed the description
- Florian Spreckelsen mentioned in merge request caosdb-pyinttest!10 (merged)
mentioned in merge request caosdb-pyinttest!10 (merged)
- Florian Spreckelsen marked the checklist item Tests written as completed
marked the checklist item Tests written as completed
- Florian Spreckelsen changed the description
Compare with previous version changed the description
- Owner
@timm Please review caosdb-pyinttest!10 (merged)
- Florian Spreckelsen added StatusReview label and removed Statustodo label
added StatusReview label and removed Statustodo label
- Florian Spreckelsen assigned to @timm
assigned to @timm
- Timm Fitschen changed the description
Compare with previous version changed the description
- Timm Fitschen closed
closed
- Timm Fitschen removed StatusReview label
removed StatusReview label