Skip to content

Commit

Permalink
fix: revert #1459 and really fix worker id check for service calls (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
justprosh committed Feb 13, 2023
1 parent ebfbf34 commit 2978847
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions particle-services/src/app_services.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,14 +302,15 @@ impl ParticleAppServices {
}
};

if service.worker_id != worker_id {
return FunctionOutcome::Err(JError::from(
ServiceError::CallServiceFailedWrongWorker {
service_id,
worker_id,
},
));
}
// TODO: figure out how to check for builtins (like registry, aqua-ipfs)
// if service.worker_id != worker_id {
// return FunctionOutcome::Err(JError::from(
// ServiceError::CallServiceFailedWrongWorker {
// service_id,
// worker_id,
// },
// ));
// }

let service_type = ServiceType::Service(service.aliases.first().cloned());

Expand Down Expand Up @@ -460,13 +461,12 @@ impl ParticleAppServices {
.get_mut(&service_id)
.ok_or_else(|| ServiceError::NoSuchService(service_id.clone()))?;

// TODO: figure out how to check for builtins (like registry, aqua-ipfs)
// if service.worker_id != worker_id {
// return Err(ServiceError::AliasWrongWorkerId {
// service_id,
// worker_id: service.worker_id,
// });
// }
if service.worker_id != worker_id {
return Err(ServiceError::AliasWrongWorkerId {
service_id,
worker_id: service.worker_id,
});
}

service.add_alias(alias.clone());
let persisted_new = PersistedService::from_service(service_id.clone(), service);
Expand Down

0 comments on commit 2978847

Please sign in to comment.