Skip to content

Commit

Permalink
fix #812
Browse files Browse the repository at this point in the history
  • Loading branch information
westnordost committed Feb 4, 2018
1 parent c1c00fb commit 3ad39ac
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,7 @@ boolean uploadQuestChange(long changesetId, OsmQuest quest, Element element,
Element elementWithChangesApplied = changesApplied(element, quest);
if(elementWithChangesApplied == null)
{
closeQuest(quest);
invalidateAreaAroundQuest(quest);
deleteConflictingQuest(quest);
return false;
}

Expand Down Expand Up @@ -246,6 +245,14 @@ private void closeQuest(OsmQuest quest)
questDB.update(quest);
}

private void deleteConflictingQuest(OsmQuest quest)
{
// #812 conflicting quests may not reside in the database, otherwise they would wrongfully
// be candidates for an undo - even though nothing was changed
questDB.delete(quest.getId());
invalidateAreaAroundQuest(quest);
}

private void invalidateAreaAroundQuest(OsmQuest quest)
{
// called after a conflict. If there is a conflict, the user is not the only one in that
Expand Down Expand Up @@ -343,8 +350,7 @@ private boolean handleElementConflict(long changesetId, OsmQuest quest,
Log.v(TAG, "Dropping quest " + getQuestStringForLog(quest) +
" because the quest is no longer applicable to the element");

closeQuest(quest);
invalidateAreaAroundQuest(quest);
deleteConflictingQuest(quest);
return false;
}
}
Expand Down

0 comments on commit 3ad39ac

Please sign in to comment.