Skip to content

WIP! address indexing issues that result in empty export from desktop app#321

Open
sethvincent wants to merge 1 commit into
masterfrom
obs-osm-indexing-fixes
Open

WIP! address indexing issues that result in empty export from desktop app#321
sethvincent wants to merge 1 commit into
masterfrom
obs-osm-indexing-fixes

Conversation

@sethvincent

Copy link
Copy Markdown
Contributor

This switches observations to use doc.nodeId for tracking the related osm node in the app.

Also this fixes the issue where osm.createNode was not being called when needed.

I've verified that observation-link documents are created with the correct values with both nodes that were imported from OSM and nodes that were created in the mobile app.

When I sync to the desktop app and export, the xml export is still empty.

Comment thread app/lib/osm-p2p.js

doc.tags = doc.tags || {};
const nodeId = doc.tags["osm-p2p-id"];
let nodeId = doc.nodeId;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we clear this property before writing it? It will be written into the observation-link object.

Comment thread app/lib/osm-p2p.js
if (nodeId) {
observationDb.create(doc, opts, onObservationCreated);
} else {
createNode({ lat: doc.lat, lon: doc.lon }, function(err, node, a, b, c) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Were a, b, c debug params?

Comment thread app/lib/osm-p2p.js
observationDb.create(doc, opts, onObservationCreated);
} else {
createNode({ lat: doc.lat, lon: doc.lon }, function(err, node, a, b, c) {
doc.nodeId = nodeId = node.value.k;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think anything requires doc.nodeId to be set on the observation. You should be able to change this to just nodeId = node.value.k.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants