Opened 12 years ago

Closed 11 years ago

#1376 closed defect (fixed)

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

Reported by: Shaun McDonald Owned by: richard@…
Priority: blocker Milestone: OSM 0.6
Component: potlatch (flash editor) Version:
Keywords: Cc:


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

Change History (9)

comment:1 Changed 12 years ago by Shaun McDonald

putway needs it too

comment:2 Changed 12 years ago by Shaun McDonald

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

comment:3 Changed 12 years ago by Shaun McDonald

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.

comment:4 Changed 12 years ago by Shaun McDonald

The refactoring has been implemented in r12223 and r12232.

comment:5 Changed 12 years ago by Richard

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.

comment:6 Changed 12 years ago by Shaun McDonald

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.

comment:7 Changed 12 years ago by Richard

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.

comment:8 Changed 12 years ago by Shaun McDonald

If you need any help let me know.

comment:9 Changed 11 years ago by Richard

Resolution: fixed
Status: newclosed

Think this is all done now.

Note: See TracTickets for help on using tickets.