Skip to content
This repository has been archived by the owner on Jul 24, 2021. It is now read-only.

putpoi needs to send current version back to the server from the swf for checking the commit #1376

Closed
openstreetmap-trac opened this issue Jul 23, 2021 · 9 comments

Comments

@openstreetmap-trac
Copy link

Reporter: smsm1
[Submitted to the original trac issue database at 12.08am, Wednesday, 3rd December 2008]

There may be other places that the swf needs to send the version back to the server for validation.

@openstreetmap-trac
Copy link
Author

Author: smsm1
[Added to the original trac issue at 5.30pm, Wednesday, 3rd December 2008]

putway needs it too

@openstreetmap-trac
Copy link
Author

Author: smsm1
[Added to the original trac issue at 7.00pm, Wednesday, 3rd December 2008]

putpoi, putway, and putrelation are getting an additional parameter version after the changeset.

@openstreetmap-trac
Copy link
Author

Author: smsm1
[Added to the original trac issue at 7.11pm, Wednesday, 3rd December 2008]

that version parameter is the current version of the node/way/relation that was downloaded from the db.
All nodes supplied to put way need it too.

Should have the refactoring of amf controller finished tomorrow afternoon.

@openstreetmap-trac
Copy link
Author

Author: smsm1
[Added to the original trac issue at 11.33am, Friday, 5th December 2008]

The refactoring has been implemented in r12223 and r12232.

@openstreetmap-trac
Copy link
Author

Author: Richard
[Added to the original trac issue at 2.36pm, Monday, 8th December 2008]

We need to be a bit clever about what to do when a conflict is detected (e.g. Potlatch originally received version 3, has just sent version 4, but the object on the server is already at version 4/5/whatever).

In particular, amf_controller needs to send back:

  • A custom error code (-3 perhaps).
  • A flag to indicate whether all the 'conflicting' changes (i.e. those made since the object was downloaded) were made by the currently logged-in user.

If any of the conflicting changes were made by another user, we have a classical edit conflict.

However, if they were all made by the current user, this usually indicates that amf_controller carried out a previous write in this session, but that Potlatch never received the response (very common in times of high server load). In that case we do not have a conflict and Potlatch should update its UI and internal data accordingly.

@openstreetmap-trac
Copy link
Author

Author: smsm1
[Added to the original trac issue at 5.18pm, Monday, 8th December 2008]

deleteway needs the version number and id for the way and all nodes. The server will then decide which nodes are unshared and need deleted.
deleteitemrelations also needs the version number whereever it is called, needs to be in a transaction.

Take a look at putrelation. It has a series of rescues, including
rescue OSM::APIVersionMismatchError => ex
where you can do the interesting stuff above.

@openstreetmap-trac
Copy link
Author

Author: Richard
[Added to the original trac issue at 12.42am, Tuesday, 16th December 2008]

Am re-refactoring putway, will probably need to do deleteway and some others as well. This isn't going to be a whole host of fun.

@openstreetmap-trac
Copy link
Author

Author: smsm1
[Added to the original trac issue at 12.43am, Tuesday, 16th December 2008]

If you need any help let me know.

@openstreetmap-trac
Copy link
Author

Author: Richard
[Added to the original trac issue at 1.35pm, Monday, 12th January 2009]

Think this is all done now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant