ContainerServices.generateContainerServicesRequestHandler does not return the container service if it doesn't implement IComponentRouter
Describe the bug
If a container service doesn't implement IComponentRouter, it doesn't returned by the generateContainerServicesRequestHandler function.
After a bit investigation the issue seems to be in the RequestParser.createSubRequest() function, the condition startingPathIndex > this.pathParts.length is not correct.
But I'll leave it to your guys to fix it since I'm not super familiar about the impact.
/**
* Creates a sub request starting at a specific path part of this request's url
*
* @param startingPathIndex - The index of the first path part of the sub request
*/
public createSubRequest(startingPathIndex: number): IRequest | undefined {
if (startingPathIndex < 0 || startingPathIndex > this.pathParts.length) {
return undefined;
}
const path = this.pathParts.slice(startingPathIndex).join("/");
return {
url: path + this.query,
headers: this.headers,
};
}
Hi @skylerjokiel, we've talked about this issue before, can you fix it and also port the fix to v0.13?
Is there a plan when this will be fixed? @skylerjokiel
Right now all the container services in bohemia repo are implementing the IComponentRouter interface in order to workaround this bug, it'd be nice to get this fixed, so that we can remove all those workaround logic in every container service.
This is potentially related to: https://github.com/microsoft/FluidFramework/issues/2677 which details a bunch of weird bugs in the requestparser's createsubrequest logic.
Pulling it along and will address this in August.
Closing this bug because the larger plan is to remove the Aqueduct Container Services code in October. It has been deprecated and replaced by the Providers pattern.
#3799