-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minor Unity Related Fixes #70
Minor Unity Related Fixes #70
Conversation
Odd that You ought to be able to override it in the _instance = new Supabase.Client(URL, PUBLIC_KEY, new Supabase.SupabaseOptions
{
Headers = new Dictionary<string, string>
{
["X-Client-Info"] = Guid.NewGuid().ToString()
}
}); |
I think The schema is a bit loose, lol. I just updated the commit to match closer to the other versions of the code (the specific GoTrue client info + assembly version) by default, while also supporting the Unity scenarios. I'm hoping to have the getting started / out-of-the-box scenario for a Unity dev to be as cake as possible, so either way I'd like a solution that "just works." If you don't like the tracking session per app launch thing, the version that would match closer semantically would probably be something like: if (!headers.ContainsKey("X-Client-Info"))
{
try
{
// Default version to match other clients
// https://github.com/search?q=org%3Asupabase-community+x-client-info&type=code
headers.Add("X-Client-Info", $"postgrest-csharp/{Util.GetAssemblyVersion(typeof(Client))}");
}
catch (Exception)
{
// Fallback for when the version can't be found
// e.g. running in the Unity Editor, ILL2CPP builds, etc.
headers.Add("X-Client-Info", $"postgrest-csharp/0.0.1");
}
} ...which looks like the express-js client version. Or perhaps just Then just doc the GUID insertion version instead. Just LMK - I prefer the out-of-box GUID for local debug but it's not that big of a deal. |
I can dig the App launch thing as a fallback - I'll need to go implement that on the other child repos! Personally I'd place the blame on the ILL2CPP compiler. But regardless, that's a fix that works for me! As always, thanks for your time @wiverson, it's much appreciated! |
What kind of change does this PR introduce?