@@ -220,8 +220,8 @@ class DatabaseConnector {
220220 @param id: String value of the node ID
221221 @return StoredNode
222222 */
223- func getNode( id: Int , version : StoredNodeVersion ) -> StoredNode ? {
224- let compoundId = " \( id) - \( version . rawValue ) "
223+ func getNode( id: Int ) -> StoredNode ? {
224+ let compoundId = " \( id) "
225225 return realm. object ( ofType: StoredNode . self, forPrimaryKey: compoundId)
226226 }
227227 /**
@@ -233,8 +233,8 @@ class DatabaseConnector {
233233// return realm.object(ofType: StoredWay.self, forPrimaryKey: Int(id))
234234// }
235235
236- func getWay( id: Int , version : StoredWayVersion ) -> StoredWay ? {
237- let compoundId = " \( id) - \( version . rawValue ) "
236+ func getWay( id: Int ) -> StoredWay ? {
237+ let compoundId = " \( id) "
238238 return realm. object ( ofType: StoredWay . self, forPrimaryKey: compoundId)
239239 }
240240
@@ -253,7 +253,7 @@ class DatabaseConnector {
253253 func addWayTags( id: Int , tags: [ String : String ] , version: Int ) -> StoredWay ? {
254254
255255 // Step 1: Try to get the editable copy first
256- if let editable = getWay ( id: id, version : . original ) {
256+ if let editable = getWay ( id: id) {
257257 // Step 2: Update the existing editable copy
258258 do {
259259 try realm. write {
@@ -279,7 +279,7 @@ class DatabaseConnector {
279279 func addNodeTags( id: Int , tags: [ String : String ] , version: Int ) -> StoredNode ? {
280280 print ( " 🟣 addNodeTags called for id: \( id) with tags: \( tags) " )
281281
282- if let editable = getNode ( id: id, version : . original ) {
282+ if let editable = getNode ( id: id) {
283283 print ( " ✏️ Editable node exists: \( editable. compoundId) " )
284284 do {
285285 try realm. write {
@@ -393,7 +393,7 @@ class DatabaseConnector {
393393
394394 func updateNodeVersion( nodeId: String , version: Int ) -> StoredNode ? {
395395 let intId = Int ( nodeId) ?? - 1
396- guard let theNode = getNode ( id: intId, version : . original ) else { return nil }
396+ guard let theNode = getNode ( id: intId) else { return nil }
397397 do {
398398 try realm. write {
399399 theNode. version = version
@@ -408,7 +408,7 @@ class DatabaseConnector {
408408
409409 func updateWayVersion( wayId: String , version: Int ) -> StoredWay ? {
410410 let intId = Int ( wayId) ?? - 1
411- guard let theWay = getWay ( id: intId, version : . original ) else { return nil }
411+ guard let theWay = getWay ( id: intId) else { return nil }
412412
413413 do {
414414 try realm. write {
0 commit comments