Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Apr 10 18:39

    alexyakunin on master

    feat: Update Fusion to v0.12.1. (compare)

  • Apr 10 02:15

    alexyakunin on master

    refactor: renames in IResult, I… (compare)

  • Apr 09 05:54

    alexyakunin on master

    misc: Minor changes in TodoApp. (compare)

  • Apr 09 04:43

    alexyakunin on master

    misc: Rename Blazorise sample t… (compare)

  • Apr 08 22:59

    alexyakunin on master

    feat: Update Fusion to v0.11.45. (compare)

  • Apr 08 22:53

    alexyakunin on master

    feat: InMemoryKeyValueStore + C… (compare)

  • Apr 08 08:26

    alexyakunin on master

    feat: Update Fusion to v0.11.44… (compare)

  • Apr 08 07:50

    dependabot-preview[bot] on nuget

    (compare)

  • Apr 08 07:50

    dependabot-preview[bot] on nuget

    (compare)

  • Apr 08 07:50
    dependabot-preview[bot] closed #264
  • Apr 08 07:50
    dependabot-preview[bot] closed #265
  • Apr 08 07:50
    dependabot-preview[bot] edited #264
  • Apr 08 07:50
    dependabot-preview[bot] edited #265
  • Apr 08 07:50
    dependabot-preview[bot] commented #264
  • Apr 08 07:50
    dependabot-preview[bot] commented #265
  • Apr 08 07:49
    dependabot-preview[bot] edited #265
  • Apr 08 07:49
    dependabot-preview[bot] edited #264
  • Apr 08 07:49

    alexyakunin on master

    misc: Update Packages.props (compare)

  • Apr 08 07:40

    alexyakunin on board-games

    (compare)

  • Apr 08 07:37

    alexyakunin on master

    feat: IIsolatedKeyValueStore, i… (compare)

Alex Yakunin
@alexyakunin
ctx ??= UserContext.Current; - and that's in every "regular" method
note that the reason you can't use the same approach in compute methods is:
their arguments are captured as a key, and the capture happens before the entry
in short,
this already adds some mess - i.e. 2 distinct approaches for "fulfilling" the default.
IMO the best option is to either pass userId directly, or create something like UserContext - a serializable & equatable type that stores all the info you might want to pass to such methods.
Alex Yakunin
@alexyakunin
We pass CancellationToken the same way everywhere, so my guess is: passing user Id won't make a huge diff.
As for the controller / web API, this argument could be really optional, assuming its value is filled in before the first [ComputeMethod] is invoked (if you need to invoke some compute methods to produce userId there, do this inside your own Computed.CaptureAsync(...) to ensure they aren't captured by [Publish] logic).
Alex Yakunin
@alexyakunin
One other thing to keep in mind is:
Let's say we use defaults for compute methods, etc.
and let's say these "background" defaults were correct on the first run.
so once you call GetYoutubeChannelsAsync(null, ct), the default user was provided.
But let's say GetYoutubeChannelAsync calls GetChannelDescriptionAsync(long? userId = null, ...), and
it doesn't pass its own userId there too - because why bother, if there is a default anyway?
now, let's say you got a computed for some GetYoutubeChannelsAsync, and now it's recomputing
but there is no default userId when this happens - because it's an operation invoked by Fusion's websocket infrastructure rather than controller method call
or there is another userId somehow
Alex Yakunin
@alexyakunin
as a result, even though correct userId will be used for GetYoutubeChannelsAsync (because the parameter it gets was updated by ArgumentHanlder), GetChannelDescriptionAsync it calls won't get the same one -- or any.
This is another reason to avoid this
i.e. it's too easy to make a mistake with defaults
@Themodem I just responded
one other good thing, btw
check out SessionInfo type
it allows you to pass custom properties
Alex Yakunin
@alexyakunin
like any number of user IDs
i.e. most of such methods should actually pass Session session parameter
and once they got it, they can use e.g. IAuthService to get User
(i.e. the service on server just resolves the user via IAuthService)
I guess I should convert chat example to use it
right now user is passed there directly as well,
though ideally Session should be passed over
Alex Yakunin
@alexyakunin
what's clear is: we clearly need a clean / minimal auth example
Alex Yakunin
@alexyakunin
long story short: please look at Stl.Fusion.Authentication - everything in this namespace
once you understand how services work there,
your problem with userId will be solved - you'll just pass Session everywhere (similarly to IAuthService)
and once you have Session, the rest is available via IAuthService API both on server & on the client.
Lee
@Themodem
@alexyakunin awesome, thanks for the info. Ill check out the session stuff :thumbsup:
Alex Yakunin
@alexyakunin
@Themodem and anyone @/all - feel free to share your repositories w/ me, I can do a quick Hangouts session to help fixing the issues
Alex Yakunin
@alexyakunin
image.png
Alex Yakunin
@alexyakunin
@Themodem thanks for the PR!
Alex Yakunin
@alexyakunin
Alex Yakunin
@alexyakunin
Part 6 is there, it covers all Blazor app scenarios (SSB, WASM, Hybrid): https://github.com/servicetitan/Stl.Fusion.Samples/blob/master/docs/tutorial/Part06.md
Alex Yakunin
@alexyakunin
Part 7 is there, but there is nothing interesting yet (JS / React client is in dev)
And Part 8 is there - "Scaling Fusion Services": https://github.com/servicetitan/Stl.Fusion.Samples/blob/master/docs/tutorial/Part08.md
Alex Yakunin
@alexyakunin

Hi everyone,
Just discovered that Blazor samples were referring to wwwroot of .NET Core 3.1 build
I.e. updated .NET 5 samples worked only if you were building .NET 3.1 versions earlier
that's a kind of epic fail :(

Luckily, this didn't impact Caching sample - unless you run it with Run-Sample-Caching.cmd, which starts .NET Core 3.1 server + .NET 5.0 client (!). My heart almost stopped beating when I noticed this today, but luckily, I ran it manually while running the tests on Nov 10th, so results that I published are the same as I saw today - I explicitly verified this a few times already. Uh-oh...

One more thing: Blazor (hybrid) sample still fails to load blazor.webassembly.js (404) - I am looking for what's wrong, likely, will fix it in a few hours, but if you know the cause - please LMK.

You can navigate to http://localhost:5005/_blazorMode/true to switch it to SSB mode

Alex Yakunin
@alexyakunin
Forgot to write here - the bug listed above was fixed.
Alex Yakunin
@alexyakunin
Quick update:
I added support for .NET Core 3.1 & Blazor there - via multi-targeting
i.e. you can use the same NuGet packages for both .NET 5.0 & .NET Core 3.1.
Alex Yakunin
@alexyakunin
Pretty sure it's not super interesting for you, but: http://fusion-samples.servicetitan.com/
Mattia
@andmattia
Hi @alexyakunin today I see stl.fusion and I've a simple question, is it possible to integrate with angular?