```\nif (!version.valid) context.latestPosition.local.invalidate(newPosition);\nnewPosition.adjust(context.latestPosition.local);\n// rest of code\ncontext.latestPosition.local.update(newPosition);\n```\n