FluidFramework icon indicating copy to clipboard operation
FluidFramework copied to clipboard

ContainerServices.generateContainerServicesRequestHandler does not return the container service if it doesn't implement IComponentRouter

Open ZeguangWu opened this issue 6 years ago • 5 comments

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,
        };
    }

ZeguangWu avatar Mar 05 '20 22:03 ZeguangWu

Hi @skylerjokiel, we've talked about this issue before, can you fix it and also port the fix to v0.13?

ZeguangWu avatar Mar 05 '20 22:03 ZeguangWu

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.

ZeguangWu avatar Apr 28 '20 18:04 ZeguangWu

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.

leeviana avatar Jul 16 '20 19:07 leeviana

Pulling it along and will address this in August.

skylerjokiel avatar Aug 07 '20 20:08 skylerjokiel

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

skylerjokiel avatar Oct 01 '20 19:10 skylerjokiel