Ticket #47 (closed task: fixed)

Opened 3 years ago

Last modified 3 years ago

vtag: set to last version problem

Reported by: bruno Owned by: bruno
Priority: major Milestone: 0.2
Component: Indexer Version:
Keywords: Cc: lily-developers@…

Description

Often when updating a record, one might want to set a vtag to the latest version. However, it is not easy to know the number of the last version: it is not sure a new version will be created, someone else might have created a version since we read the record (causing the new version to have a higher number than expected).

Maybe we should have a facility in the repository itself that can automatically set version tags to point to the last version.

Change History

comment:1 Changed 3 years ago by bruno

  • Cc lily-developers@… added

comment:2 Changed 3 years ago by bruno

  • Milestone set to 0.2

comment:3 Changed 3 years ago by bruno

For now (0.2) this would be something hardcoded, though this sort of thing might be done through a sort of "pre-create/update hook". However, since such hooks might modify content and hence influence whether or not a version will be created, this would have to be a sort of second-stage hook which is not allowed to modify versioned content.

comment:4 Changed 3 years ago by evert

The proposed design :

  • There would be only one field on a record with this behaviour: the vtag-field with the name 'last'
  • The field is updated to contain the last version number each time a new version of the record is created.
  • The field is added to the record if it is defined in the record type, it does not have to be present as to-be-updated-field in the record when calling Repository#update(Record).
  • If the field is not defined in the record type, but already exists in the record or is present on the record as to-be-updated-field, then it is also added (if not present yet) and updated.
  • If the record does not have any versions, the field is removed from the record.

Also to be changed:

  • The ImportTool? currently contains some code to fake this behaviour. This has to be removed.

comment:5 Changed 3 years ago by evert

r4197 implements the proposed design.

But this design might not be enough to cover the actual usecase where version tags automatically get the latest version filled in if needed. To be discussed !

The ImportTool? has not been adapted yet.

comment:6 Changed 3 years ago by evert

  • Status changed from new to closed
  • Resolution set to fixed

After discussion with Bruno this seems enough for now.
If for instance you have a ´live tag' you want to be able to put it to a specific version x. And not to whatever version that happens to be the latest at that moment, which could have been changed by someone else in between reading the record and setting the live tag.

Note: See TracTickets for help on using tickets.