Starcounter / Home

Starcounter is an in-memory database application engine.
https://starcounter.io
27 stars 1 forks source link

Blend responses from the same app #432

Closed warpech closed 6 years ago

warpech commented 6 years ago

In the branch https://github.com/Starcounter/UniformDocs/compare/issues/351-present-blendable-menus, @tomalec is trying to show an example of blended views where 2 views come from the same app.

The blend.json file has the entries for both of the views: https://github.com/Starcounter/UniformDocs/blob/8b8b0ae209bf30317b626007f11bc99b49850179/src/UniformDocs/blend.json#L23-L36

Me and @tomalec think that requesting one of these URIs through Self.GET should result in the other one being attached through the blending engine.

It seems that the blending engine ignores the blended views declared within the same app that is making the Self.GET call. Is this the case @alemoi? If yes, it seems to me that is unnecessary. Can we have this limitation removed?

kegor commented 6 years ago

Looks like I met a similar problem in HeadsOmni (HeadsOne): we would like to show partial page for managing recommended products on the product details page (of the same Showroom app) but we can't achieve this with adding following blending rule (latter): https://github.com/Starcounter/Showroom/blob/c449ee752761fc77a47df54bffc58d1b5d47a2ee/src/Showroom/blend.json.

warpech commented 6 years ago

@mmnosek just tested that if one app (Products) is blended with two views (Showroom), also only one view from each app is used.

It seems that the last view matching to a FullClassName + Contexts from an app is attached by the blending engine.

Expected behavior is that all matching views should be attached.

This is needed for Omni. Can it be fixed, or should we search for workarounds?

ghost commented 6 years ago

I have started the investigation. Is it that only 1 of 2 handlers is called? Or the handlers are called but not blended correctly?

mmnosek commented 6 years ago

My investigation shows that second handler is not called at all.

ghost commented 6 years ago

After fixing the issue https://github.com/Starcounter/level1/issues/4750 I tried to reproduce the problem described here on the same setup with 2 apps and couldn't. Try the next successful build to see if problem persists. If it does, I need a reproduction scenario, alike the one in https://github.com/Starcounter/level1/issues/4750

mmnosek commented 6 years ago

It still doesn't work, I checked with the 2.4.990.158. I will give you the repro scenario directly.

ghost commented 6 years ago

I have tested more in non-mapping branch and everything seems to work fine. That's why I suspect that maybe its because of mapping converters that are used in blending: https://github.com/Starcounter/level1/blob/mapping/src/Starcounter/Apps/Blender.cs#L405

Lets have a session tomorrow.

warpech commented 6 years ago

I just tested the OP (with the updated testing code https://github.com/Starcounter/UniformDocs/commit/4f83880d4d063b52a00248171a1d95e70567c3a2).

I can confirm that the problem with OP is not reproducible anymore with neither 2.4.0.6734 nor 2.4.990.127 nor 2.4.990.161.

Perhaps why we didn't see the blended page is because of the same reason as https://github.com/Starcounter/HeadsOmni/issues/263

@mmnosek, @kegor pls confirm if you still have the problem. If yes, paste code that reproduces the problem.

mmnosek commented 6 years ago

I confirm that the problem is not reproducible with 2.4.990.161

kegor commented 6 years ago

I confirm that the problem is not reproducible even with 2.4.990.127, now I am on the current master of the HeadsOmni with bumped Showroom which has updated rules in blend.json (so I agree with Marcin about https://github.com/Starcounter/HeadsOmni/issues/263): image

mmnosek commented 6 years ago

Shall we close it then? 😃

warpech commented 6 years ago

Closing as invalid